Welcome to Dream.In.Code
Become a VB Expert!

Join 149,949 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,344 people online right now. Registration is fast and FREE... Join Now!




date and time functions

 
Reply to this topicStart new topic

date and time functions, convert and format function of date and time

bhanuk
30 Sep, 2008 - 01:32 AM
Post #1

New D.I.C Head
*

Joined: 30 Sep, 2008
Posts: 1

hi i want all the convertion and format functions of data and time

User is offlineProfile CardPM
+Quote Post

akhileshbc
RE: Date And Time Functions
30 Sep, 2008 - 03:59 AM
Post #2

D.I.C Head
Group Icon

Joined: 26 Sep, 2008
Posts: 177



Thanked: 3 times
Dream Kudos: 50
My Contributions
Cdate=converts a string into date type
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Date And Time Functions
30 Sep, 2008 - 05:21 AM
Post #3

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is offlineProfile CardPM
+Quote Post

jaakko
RE: Date And Time Functions
5 Oct, 2008 - 01:39 PM
Post #4

New D.I.C Head
*

Joined: 26 Sep, 2008
Posts: 21



Thanked: 2 times
My Contributions
QUOTE(bhanuk @ 30 Sep, 2008 - 02:32 AM) *

hi i want all the convertion and format functions of data and time


This is a copy from the VB6 help. If you need more help type format anywhere in your program go into its middle and press F1

Dim MyTime, MyDate, MyStr
MyTime = #5:04:23 PM#
MyDate = #1/27/1993#

' Returns current system time in the system-defined long time format.
MyStr = Format(Time, "Long Time")

' Returns current system date in the system-defined long date format.
MyStr = Format(Date, "Long Date")

MyStr = Format(MyTime, "h:m:s") ' Returns "17:4:23".
MyStr = Format(MyTime, "hh:mm:ss AMPM") ' Returns "05:04:23 PM".
MyStr = Format(MyDate, "dddd, mmm d yyyy") ' Returns "Wednesday,
' Jan 27 1993".
' If format is not supplied, a string is returned.
MyStr = Format(23) ' Returns "23".

' User-defined formats.
MyStr = Format(5459.4, "##,##0.00") ' Returns "5,459.40".
MyStr = Format(334.9, "###0.00") ' Returns "334.90".
MyStr = Format(5, "0.00%") ' Returns "500.00%".
MyStr = Format("HELLO", "<") ' Returns "hello".
MyStr = Format("This is it", ">") ' Returns "THIS IS IT".

User is offlineProfile CardPM
+Quote Post

thava
RE: Date And Time Functions
5 Oct, 2008 - 06:44 PM
Post #5

D.I.C Regular
Group Icon

Joined: 17 Apr, 2007
Posts: 486



Thanked: 20 times
Dream Kudos: 50
My Contributions
what is meant by all formatting date
you specify your custom format a date with different format string
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 05:28PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month