SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Oct 2001
    Location
    Worcester
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Convert time to 24 hour time

    Hello --
    Columbus Day and still got to work..
    I was wondering if a function exists in Silk to convert time to 24 hour format .. EX 3:00 PM = 15:00 .

    I have not seen one, could probably write a function to convert it but didn't know if anyone existed already..

    Thanks All
    Have a good one

    ------------------

  2. #2
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Convert time to 24 hour time

    Assuming your time is a TIME variable, the easiest way to do it is to cast to a DATETIME, then use FormatDateTime to get the result outputted the way you want.


    ------------------

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Location
    Worcester
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Convert time to 24 hour time

    I knew that function existed but I have to give it the format I want.. I might be wrong but say I get a datetime field value 8/6/2002 2:34:54 PM .

    Now I want to make that value to be 8/6/2002 14:34:54 ..

    I am guessing I might have to create my own function to do that ..

    Any more Ideas will be helpfull

    ------------------

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Convert time to 24 hour time

    SilkTest help says that FormatDateTime gives you this option:

    hh Display the hour as a number with leading zeros (00-23).

    My guess is that you also need to leave off the AM/PM.

    ------------------
    Rob Kapteyn
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  5. #5
    Senior Member
    Join Date
    Oct 2001
    Location
    Worcester
    Posts
    133
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Convert time to 24 hour time

    I have played around with it some and it seems FormatDateTime will convert a 24hour format into a 12 hour format.. But the problem I have is the format I get from a field is 12 hour and I need to convert it to 24 hour..

    Hoping I am making sense..
    Thanks


    ------------------

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:02 PM.

Copyright BetaSoft Inc.