PC Review


Reply
Thread Tools Rate Thread

How do I change Date Format ??

 
 
Dan Thompson
Guest
Posts: n/a
 
      16th Jan 2008
My code

Sub CurrentTime()
MsgBox Date
End Sub

This procedure outputs a message box that displays the current date.
The problem I am facing is the date outputs like this "16/1/2008" and I
want it to output so it displays like this "16-Jan-2008" or "Jan 16, 2008"

Can someone help me on this ??

Dan Thompson

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      16th Jan 2008
Sub CurrentTime()
MsgBox Format(Date, "dd-mmm-yyyy")
End Sub

or

Sub CurrentTime()
MsgBox Format(Date, "mmm d,yyyy")
End Sub


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Dan Thompson" <(E-Mail Removed)> wrote in message
news:5DB90E42-6844-4206-BEB5-(E-Mail Removed)...
> My code
>
> Sub CurrentTime()
> MsgBox Date
> End Sub
>
> This procedure outputs a message box that displays the current date.
> The problem I am facing is the date outputs like this "16/1/2008" and I
> want it to output so it displays like this "16-Jan-2008" or "Jan 16, 2008"
>
> Can someone help me on this ??
>
> Dan Thompson
>



 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      16th Jan 2008
Pick one of these...

Private Sub CurrentTime()
MsgBox Format$(Date, "dd-mmm-yyyy")
End Sub

Private Sub CurrentTime()
MsgBox Format$(Date, "mmmm dd, yyyy")
End Sub

Rick


"Dan Thompson" <(E-Mail Removed)> wrote in message
news:5DB90E42-6844-4206-BEB5-(E-Mail Removed)...
> My code
>
> Sub CurrentTime()
> MsgBox Date
> End Sub
>
> This procedure outputs a message box that displays the current date.
> The problem I am facing is the date outputs like this "16/1/2008" and I
> want it to output so it displays like this "16-Jan-2008" or "Jan 16, 2008"
>
> Can someone help me on this ??
>
> Dan Thompson
>


 
Reply With Quote
 
Per Jessen
Guest
Posts: n/a
 
      16th Jan 2008

"Dan Thompson" <(E-Mail Removed)> skrev i en meddelelse
news:5DB90E42-6844-4206-BEB5-(E-Mail Removed)...
> My code
>
> Sub CurrentTime()
> MsgBox Date
> End Sub
>
> This procedure outputs a message box that displays the current date.
> The problem I am facing is the date outputs like this "16/1/2008" and I
> want it to output so it displays like this "16-Jan-2008" or "Jan 16, 2008"
>
> Can someone help me on this ??
>
> Dan Thompson
>


Hi Dan

Sub CurrentTime()
MsgBox Format(Date, "dd-mmm-yyyy")
MsgBox Format(Date, "mmm dd, yyyy")
End Sub

//Per


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
change date format dd/mm/yyyy to Julian date format? itzy bitzy Microsoft Excel Worksheet Functions 1 8th Dec 2009 07:42 PM
Change Date Format to Specific Text Format When Copying adambush4242@hotmail.com Microsoft Excel Misc 3 23rd Dec 2008 03:43 PM
Can I change a date with no format (20051111) to date format? =?Utf-8?B?Um9zZQ==?= Microsoft Excel New Users 2 11th Nov 2005 09:03 PM
Change german date-format in englisch date-format? pedros25 Microsoft Excel Programming 2 16th Mar 2004 10:28 AM
Change a date in text format xx.xx.20xx to a recognised date format concatenator Microsoft Excel Programming 1 24th Nov 2003 11:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:26 AM.