Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > time conversion

Reply
Thread Tools

time conversion

 
 
Andrew
Guest
Posts: n/a
 
      01-02-2004
Hi,
How can I convert seconds to hh:mm:ss format? e.g. 123456s = 34:17:36
Thanks
--
Andrew



 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      01-02-2004
Andrew wrote on 02 jan 2004 in microsoft.public.inetserver.asp.general:

> How can I convert seconds to hh:mm:ss format? e.g. 123456s = 34:17:36
>


<http://groups.google.com/groups?selm=7i6qdp%24d0j%241%40news1.xs4all.nl>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Steven Burn
Guest
Posts: n/a
 
      01-02-2004
Look into the Format function;

e.g.: Response.Write Format(Time(), "hhmmss")

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Andrew <(E-Mail Removed)> wrote in message
news:XChJb.267613$ea%(E-Mail Removed) able.rogers.com...
> Hi,
> How can I convert seconds to hh:mm:ss format? e.g. 123456s = 34:17:36
> Thanks
> --
> Andrew
>
>
>



 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      01-02-2004
Evertjan. wrote on 02 jan 2004 in microsoft.public.inetserver.asp.general:

> Andrew wrote on 02 jan 2004 in microsoft.public.inetserver.asp.general:
>
>> How can I convert seconds to hh:mm:ss format? e.g. 123456s = 34:17:36
>>

>
> <http://groups.google.com/groups?selm=7i6qdp%24d0j%241%40news1.xs4all.nl>


Or more recent:
<http://groups.google.com/groups?
selm=Xns944B7A0BC6853eejj99%40194.109.133.29>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Foo Man Chew
Guest
Posts: n/a
 
      01-02-2004
Format() is not available in ASP.

For alternatives, see these articles:
http://www.aspfaq.com/show.asp?id=2271
http://www.aspfaq.com/show.asp?id=2313





"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:(E-Mail Removed)...
> Look into the Format function;
>
> e.g.: Response.Write Format(Time(), "hhmmss")
>
> --
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> www.it-mate.co.uk
>
> Keeping it FREE!
>
> Disclaimer:
> I know I'm probably wrong, I just like taking part ;o)
>
>
> Andrew <(E-Mail Removed)> wrote in message
> news:XChJb.267613$ea%(E-Mail Removed) able.rogers.com...
> > Hi,
> > How can I convert seconds to hh:mm:ss format? e.g. 123456s = 34:17:36
> > Thanks
> > --
> > Andrew
> >
> >
> >

>
>



 
Reply With Quote
 
Andrew
Guest
Posts: n/a
 
      01-02-2004
Got it, thanks

--
Andrew


"Evertjan." <(E-Mail Removed)> wrote in message
news:Xns9464B9F9D2465eejj99@194.109.133.29...
> Andrew wrote on 02 jan 2004 in microsoft.public.inetserver.asp.general:
>
> > How can I convert seconds to hh:mm:ss format? e.g. 123456s = 34:17:36
> >

>
> <http://groups.google.com/groups?selm=7i6qdp%24d0j%241%40news1.xs4all.nl>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)



 
Reply With Quote
 
Steven Burn
Guest
Posts: n/a
 
      01-02-2004
I've got it working just fine in one of my scripts. (working alongside FSO)

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)


Foo Man Chew <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Format() is not available in ASP.
>
> For alternatives, see these articles:
> http://www.aspfaq.com/show.asp?id=2271
> http://www.aspfaq.com/show.asp?id=2313
>
>
>
>
>
> "Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
> news:(E-Mail Removed)...
> > Look into the Format function;
> >
> > e.g.: Response.Write Format(Time(), "hhmmss")
> >
> > --
> > Regards
> >
> > Steven Burn
> > Ur I.T. Mate Group
> > www.it-mate.co.uk
> >
> > Keeping it FREE!
> >
> > Disclaimer:
> > I know I'm probably wrong, I just like taking part ;o)
> >
> >
> > Andrew <(E-Mail Removed)> wrote in message
> > news:XChJb.267613$ea%(E-Mail Removed) able.rogers.com...
> > > Hi,
> > > How can I convert seconds to hh:mm:ss format? e.g. 123456s = 34:17:36
> > > Thanks
> > > --
> > > Andrew
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      01-02-2004
"Andrew" wrote:
>
> How can I convert seconds to hh:mm:ss format?
> e.g. 123456s = 34:17:36


Number.prototype.pad = function(d) {
var val = String(this)
d = Math.max(d,val.length)
for (var i=0; i<d; i++) val = "0" + val
return val.substring(val.length-d)
}

var seconds = 123456,
hh = Math.floor(seconds/3600),
mm = Math.floor(seconds%3600/60),
ss = seconds%60

return hh.pad(2) + ":" + mm.pad(2) + ":" + ss.pad(2)

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.


 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      01-02-2004
Uummm, this is vbscript, not vb/vba. No builtin Format() function in
vbscript.

Besides, this will not convert an integer containing a number of seconds to
a string in hh:mm:ss format.

Steven Burn wrote:
> Look into the Format function;
>
> e.g.: Response.Write Format(Time(), "hhmmss")
>
>
> Andrew <(E-Mail Removed)> wrote in message
> news:XChJb.267613$ea%(E-Mail Removed) able.rogers.com...
>> Hi,
>> How can I convert seconds to hh:mm:ss format? e.g. 123456s = 34:17:36
>> Thanks
>> --
>> Andrew


Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
freaky friday
Guest
Posts: n/a
 
      01-02-2004
> I've got it working just fine in one of my scripts. (working alongside
FSO)

Format is VB / VBA, not VBScript. So the only way you could have it working
is if you had a custom format() function, like the one in one of foo's
links.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PSD to XHTML Conversion Services and PSD to HTML CSS ConversionServices, PSD to Joomla, Drupal, Wordpress Conversion xhtml champs Python 0 06-21-2011 11:59 AM
PSD to XHTML Conversion Services and PSD to HTML CSS ConversionServices, PSD to Joomla, Drupal, Wordpress Conversion PSD to XHTML Conversion Services and PSD to HTML CSS Conversion Services, PSD to Joomla, Drupal, Wor VHDL 0 04-25-2011 06:43 AM
conversion operator and conversion ctor subramanian100in@yahoo.com, India C++ 2 09-15-2009 12:46 PM
Time conversion between UTC and local time andreas.profous@googlemail.com Python 2 02-09-2008 02:54 AM
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM



Advertisments