|
-
Mar 30th, 2004, 01:47 PM
#1
Thread Starter
Junior Member
Date Formatting
I am running a SmartDevice application on a handheld and want to display the current date/time. The current format it is displaying when I use the Now function is:
mm/dd/yy hh/mm/ss AM/PM
I would like it to be:
mm/dd/yyyy hh/mm/ss AM/PM
How do I do this?
-
Mar 30th, 2004, 03:38 PM
#2
Frenzied Member
If I read you right, maybe something like
VB Code:
MessageBox.Show(Format(Now, "MM/dd/yyyy hh/mm/ss tt"))
Check out User-Defined Date/Time Formats and (Format Function) and Predefined Date/Time Formats (Format Function) in MSDN.
HTH,
Mike
-
Mar 30th, 2004, 03:44 PM
#3
Lively Member
if you are using DateTimePicker:
VB Code:
Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom
Me.DateTimePicker1.CustomFormat = "mm/dd/yyyy hh/mm/ss AM/PM"
-
Mar 31st, 2004, 10:31 AM
#4
Fanatic Member
dont forget to keep your 'mm' in upper case.
dd/mm/yyyy wont work
dd/MM/yyyy will work
regards
-
Apr 2nd, 2004, 04:58 AM
#5
Lively Member
yepp it was my mistake.
it should be
VB Code:
Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom
Me.DateTimePicker1.CustomFormat = "MM/dd/yyyy"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|