Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18603

Re: How do I get current time in hh:mm

From Mike Duffy <Use.web.form@website_in_sig.com>
Newsgroups comp.lang.javascript
Subject Re: How do I get current time in hh:mm
Date 2013-02-23 16:44 +0000
Organization Your Company
Message-ID <XnsA17077826B172Usewebformwebsiteins@94.75.214.39> (permalink)
References <kg80ll$u70$1@dont-email.me> <1a679606-83c6-4dc8-8224-98135cfb4882@googlegroups.com> <3u1gi8h18qd6ik71erdd01i2u328eoekcr@4ax.com> <XnsA17070ABE82CDeejj99@194.109.133.133>

Show all headers | View raw


"Evertjan." <exxjxw.hannivoort@inter.nl.net> wrote in 
news:XnsA17070ABE82CDeejj99@194.109.133.133:


> function two(x){return (x<10)?'0'+x:''+x;};

Why not use sprintf? There are a few free ones available written in 
javscript that seem to work okay. (Warning, most of them are not good at 
handling bad input, like putting the format string as the last arg instead 
of the first, or using umimplemented features, etc.)

HH:mm === sprintf("%02d:%02d", hour, min)

-- 
http://pages.videotron.ca/duffym/index.htm

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How do I get current time in hh:mm "Tony" <tony.johansson@inport.com> - 2013-02-22 15:52 +0100
  Re: How do I get current time in hh:mm dann90038@gmail.com - 2013-02-22 14:58 -0800
    Re: How do I get current time in hh:mm Jim T. <x@y.z> - 2013-02-22 19:06 -0500
      Re: How do I get current time in hh:mm "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-23 11:04 +0100
        Re: How do I get current time in hh:mm Mike Duffy <Use.web.form@website_in_sig.com> - 2013-02-23 16:44 +0000
          Re: How do I get current time in hh:mm "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-23 23:39 +0100
            Re: How do I get current time in hh:mm Mike Duffy <Use.web.form@website_in_sig.com> - 2013-02-24 21:38 +0000
              Re: How do I get current time in hh:mm "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-02-25 00:16 +0100
    Re: How do I get current time in hh:mm Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-02-23 21:13 +0000
    Re: How do I get current time in hh:mm Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-24 19:37 +0100
      Re: How do I get current time in hh:mm Tim Streater <timstreater@greenbee.net> - 2013-02-24 18:49 +0000
        Re: How do I get current time in hh:mm Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-24 19:56 +0100
          Re: How do I get current time in hh:mm Tim Streater <timstreater@greenbee.net> - 2013-02-24 19:26 +0000
            Re: How do I get current time in hh:mm Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-24 22:30 +0100
              Re: How do I get current time in hh:mm Tim Streater <timstreater@greenbee.net> - 2013-02-24 23:00 +0000
        Re: How do I get current time in hh:mm Anders Wegge Keller <wegge@wegge.dk> - 2013-02-24 19:59 +0100
      Re: How do I get current time in hh:mm Richard Yates <richard@yatesguitar.com> - 2013-02-24 12:35 -0800
        Re: How do I get current time in hh:mm Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-24 22:23 +0100
          Re: How do I get current time in hh:mm Richard Yates <richard@yatesguitar.com> - 2013-02-24 20:40 -0800
            Re: How do I get current time in hh:mm Andrew Poulos <ap_prog@hotmail.com> - 2013-02-25 16:17 +1100
              Re: How do I get current time in hh:mm Richard Yates <richard@yatesguitar.com> - 2013-02-25 10:45 -0800
      Re: How do I get current time in hh:mm John G Harris <niam@jghnorth.org.uk.invalid> - 2013-02-25 10:04 +0000

csiph-web