Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Date parser - convert any date format to YYYYMMDDHH24MISS


  • Please log in to reply
94 replies to this topic
bruno
  • Members
  • 635 posts
  • Last active: Nov 04 2015 02:26 PM
  • Joined: 07 Mar 2011

is this a bug or something is done incorrectly?



Dougal
  • Members
  • 18 posts
  • Last active: Oct 09 2015 10:31 PM
  • Joined: 21 Nov 2013

I downloaded DateParse Version 1.05 today.

 

This code:

n := DateParse("2007-06-26T14:09:12Z")
msgbox %n%
 

returns: 2070626260912

(The hour is incorrect)

 

Is there something I need to change?

 

My timezone is currently NZDT, UTC+13

 

Changing this line works for this example:

+ (t1 = 12 ? t4 = "am" ? -12.0 : 0.0 : t4 = "am" or t4="" ? 0.0 : 12.0) . t2 + 0.0 . t3 + 0.0

 

Is it possible to have the Date parser able to process a date in this format:  "Wednesday 9 July 2014  3:10:17"

 

Both these are correctly interpreted in the version I posted at http://www.autohotke...e-6#entry640277.

 

DateParse("2007-06-26T14:09:12Z") returns "20070626140912" and DateParse("Wednesday 9 July 2014  3:10:17") returns "20140709031017".

 

Cheers



v_2
  • Members
  • 2 posts
  • Last active: Jun 30 2015 06:51 PM
  • Joined: 29 Jun 2015

Does not seem to work on:

 

[15/06/[email protected]:30:50.246-0600]

[yy/mm/[email protected]:mn:sec.msec-0600]

 

It is inside a log file I am trying to Parse.

 

Thanks!



space
  • Members
  • 520 posts
  • Last active:
  • Joined: 12 Aug 2014
@v_2 that doesn't surprise me - get rid of the @ and perhaps you need to reformat the time as well - you could write a simple pre-parser to remove the @ and trim the .msec-0600 bit before passing it on to dateparse (a small function with two or three commands SubStr and StrReplace)

v_2
  • Members
  • 2 posts
  • Last active: Jun 30 2015 06:51 PM
  • Joined: 29 Jun 2015

@v_2 that doesn't surprise me - get rid of the @ and perhaps you need to reformat the time as well - you could write a simple pre-parser to remove the @ and trim the .msec-0600 bit before passing it on to dateparse (a small function with two or three commands SubStr and StrReplace)

 

Actually I got it to work by changing it from

 

[15/06/[email protected]:30:50.246-0600]

to

[2015/06/[email protected]:30:50.246-0600]

 

So, I replaced the first "[" with "[20".  It seems to work OK with the @, the time and the extra information at the end.  This will work until the year 2100, good enough for me.