Date and Time Formatting

Results 1 to 2 of 2

Thread: Date and Time Formatting

  1. #1
    Steven Johnson Guest

    Default Date and Time Formatting

    Does anyone know of a time or date formatting function in JScript or do I need to write one? I am looking to return a date to a hidden field in a form with the format &#039yyyy-mm-dd HH:MM:SS&#039

  2. #2
    John T Guest

    Default RE: Date and Time Formatting

    Heres one I did earlier - just add Hours Mins & secs + formating<BR>NB ensure that you send a valid Date object to it first!!<BR><BR>function julesDate(d){<BR> d=(julesDate.arguments.length!=1)?new Date():d;<BR> var s;<BR> s=d.getUTCFullYear()+""+(d.getUTCMonth()+1)+""+d.g etUTCDate();<BR> return(s);<BR>}<BR><BR>

Posting Permissions

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