Alpha Video Training
Results 1 to 6 of 6

Thread: Problem:Decimal Time to Standard Time

  1. #1
    Member
    Real Name
    Greg Williams
    Join Date
    Sep 2001
    Posts
    321

    Default Problem:Decimal Time to Standard Time

    I have been writing a gateway for a payroll program, and the data is exported from the timeclock in decimal (9.50 rather than 9:30)

    Is there any way to convert these times with a calculated field?

    I broke out the decimal portion with the INT() command, but then when I total all the individual lines for an employee it doesn't recognize that the integer portion should increase after 59 minutes, so I end up with something like this: 77:70.

    HHHEEELLLPPP Please!

    thanks in advance

  2. #2
    Member
    Real Name
    Stephen Williams
    Join Date
    Apr 2000
    Location
    Oakland, CA
    Posts
    930

    Default RE: Problem:Decimal Time to Standard Time

    Mess with this...
    TOSECONDS(END)-TOSECONDS(START))/3600

  3. #3
    Member
    Real Name
    Stephen Williams
    Join Date
    Apr 2000
    Location
    Oakland, CA
    Posts
    930

    Default RE: Problem:Decimal Time to Standard Time

    And going the other way...
    Jhrs = int(Flh/Calc->Size)
    Jmins = mod(Flh/Calc->Size,1)*60
    Time = alltrim(str(Calc->Jhrs))+":"+alltrim(str(Calc->Jmins))

  4. #4
    Member
    Real Name
    Stephen Williams
    Join Date
    Apr 2000
    Location
    Oakland, CA
    Posts
    930

    Default RE: Problem:Decimal Time to Standard Time

    OOps - going too fast here, FLH is a decimal hour quantity...

  5. #5
    Member
    Real Name
    Stephen Williams
    Join Date
    Apr 2000
    Location
    Oakland, CA
    Posts
    930

    Default RE: Problem:Decimal Time to Standard Time

    Oh dear - I am adjusting for crew sizes and all sorts of stuff and nonsense

    From my interactive editor
    Decimal_time = 9.50
    Time = alltrim(str(int(Decimal_time)))+":"+alltrim(str(mod(Decimal_time,1)*60))
    ?time
    = "9:30"

  6. #6
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default RE: Problem:Decimal Time to Standard Time

    Stephen,

    No, NO, NOOOOO! {:?)
    As a duly deputized member of the function police, I sentence you to 50 re-reading of the XBasic manual! However, since you do contribute to the board, I'll ask the judge to reduce your sentence to 25 re-readings of the manual!!!!

    To convert decimal minutes you would simply use

    TOTIME(decimaltime*3600,FormatCode,DecimalPlaces)
    which in most cases would be something like

    timetext=TOTIME(9.50*3600,2,0)

    To convert the other way,

    TOSECONDS(timetext)/3600

    Regards,

    Ira J. Perlow
    Computer Systems Design & Associates
    csda@mediaone.net

Similar Threads

  1. How to convert char time to time value
    By Steven Taylor in forum Alpha Five Version 6
    Replies: 5
    Last Post: 11-19-2004, 09:04 PM
  2. Part time or full time Alpha Develoeprs
    By Henry Rothschild in forum Announcements
    Replies: 5
    Last Post: 06-26-2004, 03:08 PM
  3. Time Problem
    By GregOnline in forum Alpha Five Version 5
    Replies: 1
    Last Post: 06-25-2004, 05:03 PM
  4. Seeking part time or full time Alpha Four and/or A
    By Henry Rothschild in forum Alpha Four Version 6 and Prior
    Replies: 0
    Last Post: 06-18-2004, 01:01 AM
  5. Problem: Decimal time to Standard Time
    By GregOnline in forum Alpha Five Version 4
    Replies: 3
    Last Post: 09-11-2001, 05:22 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
  •