Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / November 2007



Tip: Looking for answers? Try searching our database.

convert a date type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Claudia Fong - 23 Nov 2007 14:33 GMT
I have a date type field that is 23/11/2007 14:30:45 and I want to
convert to 2007-11-23 14:30:45. How can I do that?
I used

Format(TTime, "yyyy-mm-dd") where TTime is the variable that stores my
data.. but this only give me the first part.. the time dissapeared..

Can someone help me?

Cheers!

   Claudi
Ralph - 23 Nov 2007 17:45 GMT
> I have a date type field that is 23/11/2007 14:30:45 and I want to
> convert to 2007-11-23 14:30:45. How can I do that?
[quoted text clipped - 4 lines]
>
> Can someone help me?

Displays time with leading zeros: "2007-01-23 14:05:02"
Format(TTime, "yyyy-mm-dd Hh:Nn:Ss")

Lookup the article: "User-Defined Date/Time Formats (Format Function)" on
the MSDN help CD.

-ralph
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.