Consulting

Results 1 to 4 of 4

Thread: Solved: Current Timestamp "Now" funtion format change

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Jul 2008
    Posts
    18
    Location

    Solved: Current Timestamp "Now" funtion format change

    I use the "now" function in a textbox to get the timestamp of the systems time but its very basic time and date.

    for example [VBA]TextBox1 = Now[/VBA]

    I get the following result "04/12/2008 13:11:42"

    Is there a way to change the format to say "04/DEC/2008 1.11PM" or "04/DEC/2008 13:11" without the seconds showing?

  2. #2
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    For military time:
    [VBA]Format(Date,"mm/dd/yyyy") & " " & Format(Time,"h.Nn")[/VBA]
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,443
    Location
    [vba]

    TextBox1.Text = Format(Now, "dd/mmm/yyyy h:mm AM/PM")
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    VBAX Regular
    Joined
    Jul 2008
    Posts
    18
    Location
    cheers xld! just what i needed, nice and simple coding!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •