473,761 Members | 3,187 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any easier way to unusual convert date format?

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
Jul 19 '05 #1
2 4068
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

On Wed, 28 Jul 2004 01:14:07 -0400, ohaya <oh***@cox.ne t> wrote:
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


Jul 19 '05 #2
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.

ohaya wrote:
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


Jul 19 '05 #3

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

Similar topics

4
5390
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm working on it but not making much progress. Is there any free code available anywhere? I know it...
5
16334
by: goochey | last post by:
I'm trying to convert a Julian Date (Format "4365") into an actual calendar date in Visual Basic, can anyone help me out with this.
2
5087
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings set to "en-UK" and date to
12
3859
by: DC Gringo | last post by:
How can I convert this pubLatest to a date with format "m/d/yyyy"? Dim pubLatest As New Date pubLatest = Me.SqlSelectCommand1.Parameters("@pubLatest").Value -- _____ DC G
1
4606
by: abcabcabc | last post by:
I write an application which can let user define own date format to input, How to convert the date string to date value with end-user defined date format? Example, User Defined Date Format as "dd/MM/yyyy" input as "01082003" convert to date value as, 01 Aug 2003 Example, User Defined Date Format as "yyyy,dd,MM"
7
5373
by: Rithish | last post by:
Hello. I noticed a strange thing while using strtotime() and date() functions in combination to generate from MySQL into a readable format. By default, the MySQL date field will be 0000-00-00 00:00:00 When I pass this to strtotime() to generate the timestamp, and then pass it to the date function, it generates 30-11-1999. <? print ( "<br> strtotime for '0000-00-00 00:00:00' : " . strtotime (
2
16807
by: thewilldog | last post by:
Hello, I've reviewed the archives here to address the issue, but I'm still running into problems. I've got a table field populated with the record date in text "YYYYMMDD" To convert it into a recognizable date format, I've done the following: Query 1: References Source Table; Isolates Year, Day; creates MMDD field Acc Open Year: Left(,4) Acc Open Day: Right(,2) MMDD: Right(,4) Query 2: References Query 1; Isolates Month
4
30265
by: Ashraf Ansari | last post by:
Hi, How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date which is converted into dd/MM/yyyy should be in DateTime format. I do not want to store it as a string. Please help Thanks in advance
4
4528
by: thomasc1020 | last post by:
This is regarding VB.NET 2003. Variable 'Date' is a string and it contains date information in this format: "DEC/05/2007". Now I am trying to convert the format as "2007-12-05". Is it possible to convert the arrangement using 'Format' method? If so, please educate me how I can do such operation. Thank you!
0
9538
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9975
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9909
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8794
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7342
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6623
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5241
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2765
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.