Date conversion
Date conversion
Date conversion
Date conversion
Date conversion
Date conversion Date conversion Date conversion Date conversion Date conversion Date conversion Date conversion Date conversion
Date conversion Date conversion
Date conversion
Go Back  Xtreme Visual Basic Talk > > > Date conversion


Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2003, 06:22 AM
snufse's Avatar
snufse snufse is offline
Centurion
 
Join Date: Jul 2003
Location: West Palm Beach FL
Posts: 180
Default Date conversion


Happy holidays !!
I am looking for a class/method or code that will convert date to ccyymmdd format. Also I am looking for same to convert time from am/pm to 24 hour format. In any one can help I would appreciate it. Thank you.
Reply With Quote
  #2  
Old 12-18-2003, 06:24 AM
00100b's Avatar
00100bDate conversion 00100b is offline
Martian In Disguise

Retired Moderator
* Guru *
 
Join Date: May 2003
Location: Minneapolis, MN
Posts: 9,566
Default

See the Format function in VB's Help files (MSDN).
Code:
' Example usage for date format Debug.Print Format(Date, "yyyymmdd") ' Example usage for time format Debug.Print Format(Time, "Hh:Nn")

Edit by 00100b:
DOH! Still getting used to having VB.NET Forums
__________________
The only stupid question is the one that goes un-asked.

Last edited by 00100b; 12-18-2003 at 07:03 AM.
Reply With Quote
  #3  
Old 12-18-2003, 07:01 AM
Csharp's Avatar
CsharpDate conversion Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

vb.net has a lot of inbuilt functions for the job , take a look at the DateAndTime namespace
here's a couple of simple examples...
Code:
'///time... Dim time As String = DateAndTime.Now.TimeOfDay.Hours & ":" & DateAndTime.Now.TimeOfDay.Minutes & ":" & DateTime.Now.Second MessageBox.Show(time)
Code:
'///date... Dim dt As String = DateAndTime.Now.ToShortDateString '/// 18/12/2003 Console.WriteLine(dt) '/// or dt = DateAndTime.Now.ToLongDateString '/// 18/December/2003 Console.WriteLine(dt)
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
US to UK date conversion PrivatePile General 2 01-21-2003 05:57 AM
English To Nepali Date Conversion Simon Kale General 4 12-02-2002 06:57 PM
Date conversion jhwkgirl Web Programming 1 10-28-2002 07:11 PM
Date Conversion in SQL - HELP! jhwkgirl Database and Reporting 6 10-28-2002 03:03 PM
comparing dates with visual foxpro and ado azwaan General 8 01-08-2002 05:50 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Date conversion
Date conversion
Date conversion Date conversion
Date conversion
Date conversion
Date conversion Date conversion Date conversion Date conversion Date conversion Date conversion Date conversion
Date conversion
Date conversion
 
Date conversion
Date conversion
 
-->