Any easier way to unusual convert date format?

O

ohaya

Hi,

I'm working with a date string with a format as follows:

Sat Dec 25 21:32:59 EST 2004

and I want to compare it to another date string of the format:

7/28/2004

I'm only interested in comparing the date part, not the time.

Other than writing code to convert each of the formats to, say,
YYYYMMDD, can someone suggest an easier way to do this in ASP/VBSCRIPT?

Thanks in advance,
Jim
 
B

Bã§TãRÐ

Its an unusual date formatting,

the first thing I would try is to play around with some LCID settings and see if that can force the date into something more useable.
LCID are location Identifiers and change the system settings (time, currency etc) based upon the ID.

If that doesnt work - I would then try a Mid function to strip out the time stamp and then rebuild it into a readable date like
Sat, Dec 25, 2004 - once you have that you could apply the VB FormatDateTime (use format number 2) to make it into the other date format.

Last but not least is o do a lot of coding to get it exactly the way you want by getting the length, stripping some stuff out etc. I'd try that only as a last resort though.

Good luck
-Bastard
 
J

joker

Two words Regular expressions. I have some that I have written to be
able to take a date only format entry, validate it, & reformat it into
whatever order I want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top