in reply to changing a string to a useable date time

I'm not sure I understand your question. The string you show, "1998073001003", already seems to be in YYYYMMDDhhmmss format.

If you want to extract the parts of that date, I reccomend simply using substr or unpack. Unpack would be faster but only works of the date fields are of constant width, which they appear to be.

  • Comment on Re: changing a string to a useable date time

Replies are listed 'Best First'.
Re^2: changing a string to a useable date time
by cpiety (Novice) on Feb 01, 2005 at 15:14 UTC
    Hi, If I try say to plot this in Excel I can't change the format to recognize it as a datetime. I would also like to keep track of changing times (i.e. how many consectutive hours do I have) and I think I will have trouble doing comparisons when I change days in the current format. Its somewhat hard to read now too for manually scanning the data. Thanks for the help friedo, charles