date and time functions

convert and format function of date and time

Page 1 of 1

4 Replies - 7135 Views - Last Post: 05 October 2008 - 07:44 PM Rate Topic: -----

#1 bhanuk   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 30-September 08

date and time functions

Post icon  Posted 30 September 2008 - 02:32 AM

hi i want all the convertion and format functions of data and time
Is This A Good Question/Topic? 0
  • +

Replies To: date and time functions

#2 akhileshbc   User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 179
  • Joined: 27-September 08

Re: date and time functions

Posted 30 September 2008 - 04:59 AM

Cdate=converts a string into date type
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: date and time functions

Posted 30 September 2008 - 06:21 AM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#4 jaakko   User is offline

  • New D.I.C Head

Reputation: 7
  • View blog
  • Posts: 21
  • Joined: 26-September 08

Re: date and time functions

Posted 05 October 2008 - 02:39 PM

View Postbhanuk, on 30 Sep, 2008 - 02:32 AM, said:

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".
Was This Post Helpful? 0
  • +
  • -

#5 thava   User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,607
  • Joined: 17-April 07

Re: date and time functions

Posted 05 October 2008 - 07:44 PM

what is meant by all formatting date
you specify your custom format a date with different format string
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1