Solved

formatting the mssql date/time stamp output

Posted on 2004-09-08
6
320 Views
Last Modified: 2006-11-17
greetings.  i have a particular problem where i need to take the output of an mssql date/time stamp and format it from:

8/18/2004
10:48:10 AM

to

Aug 18

or Aug 18 2004

any ideas?
0
Comment
Question by:nmotion
  • 4
  • 2
6 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010471
Sure--use formatDateTime()

For details, please see:

http://www.devguru.com/Technologies/vbscript/quickref/formatdatetime.html

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010483
Response.Write(FormatDateTime(Date(),1))

0
 
LVL 1

Author Comment

by:nmotion
ID: 12010569
any way to omit certain parts of the output?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 125 total points
ID: 12010639
Sure, do this:

arrDateParts = Split(FormatDateTime(Date(),1)," ")

Now arrDateParts(0) will hold the long day name,  arrDateParts(1) the long month, arrDateParts(2) the day number and etc.

Just mix and match, i.e. response.write(arrDateParts(1) & " ' arrDateParts(2))

FtB
0
 
LVL 1

Author Comment

by:nmotion
ID: 12010861
Thanks a bunch!!
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 12010884
Glad to have helped,

FtB
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now