Results 1 to 10 of 10

Thread: mm/dd/yy hh:nn

  1. #1
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    With mm/dd/yy hh:nn as the format, it always displays 05/06/2009 09:45 as 05/06/2009 9:45.
    How can I define the format such that the time can be displayed as "09:45".
    Thanks.
    Armstrong

  2. #2
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you tried hh:mm, have not come accross hh:nn but I might be wrong.

  3. #3
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='ZOR' post='773937' date='06-May-2009 23:02']Have you tried hh:mm, have not come accross hh:nn but I might be wrong.[/quote]
    Zor,
    Thanks for your help. In accordance with the online help, the format specifiers for TIME should be:
    h Hour in one or two digits, as needed (0 to 23).
    hh Hour in two digits (00 to 23).
    n Minute in one or two digits, as needed (0 to 59).
    nn Minute in two digits (00 to 59).
    s Second in one or two digits, as needed (0 to 59).
    ss Second in two digits (00 to 59).
    ttttt Same as the Long Time predefined format.
    AM/PM Twelve-hour clock with the uppercase letters "AM" or "PM", as appropriate.
    am/pm Twelve-hour clock with the lowercase letters "am" or "pm", as appropriate.


    The screenshot shows the property settings.

    My core question: n and nn make no difference. But why?

    System Info:
    windows XP SP3
    Access 2007 SP2

    Please help. Thanks.

    Armstrong
    Attached Images Attached Images

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post
    [quote name='ZOR' post='773937' date='06-May-2009 16:02']Have you tried hh:mm, have not come accross hh:nn but I might be wrong.[/quote]

    ZOR, the format is correct, nn is used so as not to confuse gainst mm which, as you know, is month.
    Jerry

  5. #5
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Jezza for correcting me, thats the problem with the blind leading the blind.

    Feeling guilty, I looked around google, and found this to try. After the hh add \:nn\:ss, so you get hh\:nn\:ss. I tried it and got my screenshot, although showing all my output Does it do anything at your end?
    Attached Images Attached Images

  6. #6
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='ZOR' post='774048' date='07-May-2009 14:41']Thanks Jezza for correcting me, thats the problem with the blind leading the blind.

    Feeling guilty, I looked around google, and found this to try. After the hh add \:nn\:ss, so you get hh\:nn\:ss. I tried it and got my screenshot, although showing all my output Does it do anything at your end?[/quote]
    Zor,
    Thanks for your help. I tried out your solution in vain.
    Format property: mm/dd/yy hh\:nn\:ss
    The screenshot shows the hours can't be displayed as 2 digits.
    Attached Images Attached Images

  7. #7
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The following screenshot shows the format definition:
    Attached Images Attached Images

  8. #8
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just wonder if is something to do with your regional settings on your PC. I looked at mine and saw there were options for ommiting the leading zero on hours and minutes.

    Another link I found was :

    http://msdn.microsoft.com/en-us/libr...50(VS.60).aspx
    Attached Images Attached Images

  9. #9
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='ZOR' post='774122' date='07-May-2009 23:37']I just wonder if is something to do with your regional settings on your PC. I looked at mine and saw there were options for ommiting the leading zero on hours and minutes.

    Another link I found was :

    http://msdn.microsoft.com/en-us/libr...50(VS.60).aspx[/quote]
    Hi Zor,
    Bingo! Your solution works like a charm. Previously I thought the format specifiers could have overridden whatever regional settings.
    Thanks a lot for your help.
    Armstrong

  10. #10
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey, thats good news. I'm glad my bungling along got you there. Regards

Posting Permissions

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