473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

problem using the strptime function on HPUXThe strptime function works just

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.

Jan 4 '06 #1
4 2260

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.

Jan 4 '06 #2
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/>
Jan 4 '06 #3
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.
Jan 4 '06 #4
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

Jan 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dave Harrison | last post by:
Ok before I start, please dont mail me telling me to use a more recent version of Python, I _would_ use 2.2.x but due to an existing framework all based on using 2.1.1 I have been specifically told...
0
by: Brett C. | last post by:
I have received a few requests since the 'Python Cookbook' was published to edit my code for a strptime() function in pure Python to run on Jython 2.1 . I have finally come about and made the...
4
by: Afanasiy | last post by:
Can I easily convert from ISO to Gregorian calendars in Python 2.3? For example, what Gregorian date is year 2004, week 1, day 1? If possible, I'd greatly prefer to do this with the standard...
8
by: Adam Monsen | last post by:
Anyone know of something that works like time.strptime(), but for other languages? Specifically, Dutch (ex: "31 augustus 2005, 17:26") and German? Thinking out loud... since "31 augustus 2005,...
2
by: Robert | last post by:
A certain DAV server reports a time stamp as "Tues, 30 Aug 2005 20:48:31" ( but not "Tue, ..." as usual) This produces the error below. >>> time.strptime("Tue, 30 Aug 2005 20:48:31","%a, %d...
1
by: mimmo | last post by:
I have a problem while calculating timezone (from Europe/Rome to Brazil/East). Can someone help me ?? Thank you, Mimmo. On this site http://www.timezoneconverter.com/cgi-bin/tzc.tzc I have...
6
by: Wavelet | last post by:
want to parse the user inputed date format with strptime() function in Linux. For example,"12,17:30:20" will be explained as day 12, hour 17 etc. And I want to get the exact day. I used the...
0
by: Fabio Durieux Lopes | last post by:
Hi, I'm trying to execute some operations based on a file's time. The file's time is actually the file's name (e.g. FILE1_20080326170558). So I do this: fileTimeInSecs =...
3
by: W. eWatson | last post by:
Apparently, use of strptime of datetime needs a workaround in Python 2.4 to work properly. The workaround is d = datetime.datetime(*(time.strptime(date_string, format))). However, when I try to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.