Solved

formatting the mssql date/time stamp output

Posted on 2004-09-08
6
321 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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