Professional Web Applications Themes

military time - Macromedia Director Lingo

Anyone have some existing code that converts "the long time" to military time? TIA!...

Sponsored Links
  1. #1

    Default military time

    Anyone have some existing code that converts "the long time" to military
    time?

    TIA!


    Sponsored Links
    McDLT Guest

  2. #2

    Default Re: military time

    I am also working on something with time and converting it.

    on prepareMovie

    if offset (":",the time) then the itemDelimiter = ":"
    else the itemDelimiter = "."
    hours = value(the time.item[1])
    minutes = value (the time.item[2])
    if the time contains "PM" then
    hours = hours + 12
    end if
    startTime = (60 * hours) + minutes

    End


    Now "startTime" can be used. It has made minutes out of everything. 1 hour =
    60 min.

    You can use the same principle for military time.

    Just say if the time contains "PM" then ...

    You can also find help in another growing Director forum.
    [url]http://www.shocksites.com/forum[/url]

    Also the site has lots of samples and tutorials

    -Troy



    On 7/8/03 5:14 PM, in article befc91$g61$1forums.macromedia.com, "McDLT"
    <mdrebenstedtNO-SPAMmn.rr.com> wrote:
    > Anyone have some existing code that converts "the long time" to military
    > time?
    >
    > TIA!
    >
    >
    Troy Hipolito Guest

  3. #3

    Default Re: military time

    You can also use lingo date objects -

    on XGetTime (format12hr)
    --Param format12hr {optional}
    --Returns returns proplist [#Hr: Int, #Min: Int, #Sec: Int]

    t = (the systemDate).seconds
    hr = t/3600
    if format12hr then hr = hr mod 12
    mins = (t/60) - (hr*60)
    sec = t mod 60
    return [#hr: hr, #Min: mins, #sec: sec]
    End

    ----

    Currenttime = XGetTime ()
    Miltime = Currenttime .hr & ":" & Currenttime.mins



    Luke

    LukeWig Guest

Similar Threads

  1. military time with Date::Calc
    By Schmidty in forum PERL Modules
    Replies: 3
    Last Post: June 10th, 10:07 AM
  2. Formatting a time field to 24 hour time (Military time) in the Datagrid
    By David Hearn in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: September 10th, 02:50 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139