Skip navigation
Currently Being Moderated

Time Calculations.   PLEASE HELP

Jul 31, 2006 5:28 AM

Does anyone have some quick tips on how to calculate time - I have managed successufully to calculate the time but I'm having a hard time deducting another field (lunch hour).

????
 
Replies
  • Currently Being Moderated
    Jul 31, 2006 7:37 AM   in reply to (MEG_OCONNOR)
    You basically will need an understanding of the Date() object in the JavaScript model.

    Some methods:

    getDate() - day of the month
    getDay() - day of the week
    getHours() - hour (0-23)
    getMinutes() - minutes
    getSeconds() - seconds
    getMonth() - month (0-11)
    getYear() - year
    getTime() - time in full format

    To produce today's date:
    var today_date= new Date()
    var myyear=today_date.getYear()
    var mymonth=today_date.getMonth()+1
    var mytoday=today_date.getDate()

    document.write("Today's date is: ")
    document.write(myyear+"-"+mymonth+"-"+mytoday)
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 16, 2011 6:55 AM   in reply to (MEG_OCONNOR)

    hello,

    How do you calculate time? what i whant is, that 01.30 + 01.30 = 03.00 ( not 2.60)

    can you help me ?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)