Solved

formatting the mssql date/time stamp output

Posted on 2004-09-08
6
322 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Forcing form refresh - classic ASP 7 73
Auto Submit on dropdown box 14 72
Button to go back 3 28
Writing comments on <p></P> or paragraph 2 19
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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…

820 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