Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > problem using the strptime function on HPUXThe strptime function works just

Reply
Thread Tools

problem using the strptime function on HPUXThe strptime function works just

 
 
kongkolvyu
Guest
Posts: n/a
 
      01-04-2006
Hi
The strptime function works just fine on Solaris.
Here is an example on how I use it:
struct tm tmpTm;
if(strptime("20010101010101","%Y%m%d%H%M%S",&tmpTm )==NULL)
printf("Error,String convert to time Error\n");
On the HPUX platform, this call to strptime always returns NULL.
Does anybody have an idea why this does not work.

 
Reply With Quote
 
 
 
 
tmp123
Guest
Posts: n/a
 
      01-04-2006

kongkolvyu wrote:
> Hi
> The strptime function works just fine on Solaris.
> Here is an example on how I use it:
> struct tm tmpTm;
> if(strptime("20010101010101","%Y%m%d%H%M%S",&tmpTm )==NULL)
> printf("Error,String convert to time Error\n");
> On the HPUX platform, this call to strptime always returns NULL.
> Does anybody have an idea why this does not work.



Hi,

I suggest you to add a few spaces between fields, like:

strptime("2001 01","%Y %m",..

Kind regards.

PS: Problem reproduced and proposal verfied in a Tru64 machine.

 
Reply With Quote
 
 
 
 
Chuck F.
Guest
Posts: n/a
 
      01-04-2006
kongkolvyu wrote:
>
> The strptime function works just fine on Solaris.
> Here is an example on how I use it:
> struct tm tmpTm;
> if(strptime("20010101010101","%Y%m%d%H%M%S",&tmpTm )==NULL)
> printf("Error,String convert to time Error\n");
> On the HPUX platform, this call to strptime always returns NULL.
> Does anybody have an idea why this does not work.
>

Because strptime is not a standard C function, and you failed to
show its source code, we cannot comment on it in any way.

Whenever you need to specify a platform, you are probably off-topic
here.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      01-04-2006
tmp123 wrote:
> kongkolvyu wrote:
>> Hi
>> The strptime function works just fine on Solaris.
>> Here is an example on how I use it:
>> struct tm tmpTm;
>> if(strptime("20010101010101","%Y%m%d%H%M%S",&tmpTm )==NULL)
>> printf("Error,String convert to time Error\n");
>> On the HPUX platform, this call to strptime always returns NULL.
>> Does anybody have an idea why this does not work.

>
> I suggest you to add a few spaces between fields, like:


<snip>

It's a POSIX function, not part of standard C, so please redirect
further discussion of it to somewhere POSIX is topical, such as
comp.unix.programmer.

<OT>
How is strptime to know that you are not talking about some date in the
year 2AD? Or the year 20010AD? Or the year 20010101010101AD?
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
 
Reply With Quote
 
Old Wolf
Guest
Posts: n/a
 
      01-04-2006
kongkolvyu wrote:

> Hi
> The strptime function works just fine on Solaris.
> Here is an example on how I use it:
> struct tm tmpTm;
> if(strptime("20010101010101","%Y%m%d%H%M%S",&tmpTm )==NULL)
> printf("Error,String convert to time Error\n");
> On the HPUX platform, this call to strptime always returns NULL.
> Does anybody have an idea why this does not work.


RTFM. Or if the HPUX man page on strptime does not shed any
light on the matter, post your question in a HPUX newsgroup or
some other support channel for HPUX.

You could also try outputting the desired date with strftime, and
seeing what it looks like. Usually strptime functions are designed
to be able to take the output of strftime as an input. YMMV

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Problem with strptime in Python 2.4 W. eWatson Python 5 09-09-2008 04:27 AM
Syntax Problem with strptime in Python 2.4 W. eWatson Python 0 09-08-2008 09:51 AM
Is there a Python MVC that works just as well with just CGI, or FCGI? walterbyrd Python 1 04-10-2006 07:57 PM
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57