javascript time picker into unixtimestamp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • l3mon
    New Member
    • Mar 2009
    • 16

    javascript time picker into unixtimestamp

    I need a way to get this script to work where the user can pick a time (using this) and a date (using this) and then have PHP process that for a unixtimestamp.
  • Ciary
    Recognized Expert New Member
    • Apr 2009
    • 247

    #2
    Originally posted by l3mon
    I need a way to get this script to work where the user can pick a time (using this) and a date (using this) and then have PHP process that for a unixtimestamp.
    i think you best use strftime() and strtotime()

    then you form the format you need in strftime. remember PHP is only executed on page load so you'll have to reload the page (or use ajax) to format dates

    Comment

    • l3mon
      New Member
      • Mar 2009
      • 16

      #3
      Originally posted by Ciary
      i think you best use strftime() and strtotime()

      then you form the format you need in strftime. remember PHP is only executed on page load so you'll have to reload the page (or use ajax) to format dates
      Ok! thanks! I was going to lookinto strpos() and substr() and then put that in mktime() but this looks faster!

      Comment

      • Ciary
        Recognized Expert New Member
        • Apr 2009
        • 247

        #4
        it is :) strtotime is even capable of turning "twentyfift h of december 2009" into a timestamp. maybe even "christmas 2009" but i'm not sure there. it's a very powerful command. but be careful with "02-04-09", it might reply the wrong timestamp.

        Comment

        Working...