Date formats etc...

J

jodleren

Hi all

I get data like this: lastgood_master=1233582125, the number is a unis
number:

" Returns the current time measured in the number of seconds since the
Unix Epoch (January 1 1970 00:00:00 GMT). "

And I need to do 2 things
1) show that date is some format (dd.mm hh:nn) in ASP
2) check with the current time in ASP - meaning that I get now() which
I have to compare it with.

Any ideas anyone

TIA
Sonnich
 
B

Bob Barrows

jodleren said:
Hi all

I get data like this: lastgood_master=1233582125, the number is a unis
number:

" Returns the current time measured in the number of seconds since the
Unix Epoch (January 1 1970 00:00:00 GMT). "

And I need to do 2 things
1) show that date is some format (dd.mm hh:nn) in ASP
2) check with the current time in ASP - meaning that I get now() which
I have to compare it with.

To convert it to a datetime, use DateAdd to add the seconds to the seed
datetime.

d=DateAdd("ss",lastgood_master,#1/1/1970#)

Then add/subtract the offset to get it to your timezone.
 
E

Evertjan.

Bob Barrows wrote on 02 feb 2009 in
microsoft.public.inetserver.asp.general:
To convert it to a datetime, use DateAdd to add the seconds to the seed
datetime.

d=DateAdd("ss",lastgood_master,#1/1/1970#)

"s"

d = DateAdd("s",lastgood_master,#1970/1/1#)

The OQ being "in ASP",
the below is just as good:

d = new Date(lastgood_master * 1000);
 
J

jodleren

Bob Barrows wrote on 02 feb 2009 in
microsoft.public.inetserver.asp.general:






"s"

d = DateAdd("s",lastgood_master,#1970/1/1#)

The OQ being "in ASP",
the below is just as good:

d = new Date(lastgood_master * 1000);

Thanks, that was it (and simple, if only I know more about ASP)

Still, the date format is next
 
E

Evertjan.

jodleren wrote on 03 feb 2009 in
microsoft.public.inetserver.asp.general:
Thanks, that was it (and simple, if only I know more about ASP)

Do you really understand that ASP is not a language, but a platform,
and that

d = DateAdd("s",lastgood_master,#1970/1/1#)

is VBscript

and

d = new Date(lastgood_master * 1000);

is J[ava]script?
(and simple, if only I know more about ASP)

Well, start learning and experimenting,
the above being not that simple.

Perhaps I am underestimating you,
but that is the way if do not even sign your postings?
 
J

jodleren

jodleren wrote on 03 feb 2009 in
microsoft.public.inetserver.asp.general:



Do you really understand that ASP is not a language, but a platform,
and that

I am awere of that, mostly I work in PHP, and for the little work I do
in ASP it is more a language - maitaining existing stuff.
I am browsing this NG, and I have got it all now - the saving (new
post) is not needed really, except for testing (the test server cannot
send mail), but I am slowly learning :)

And I should sign :)

WBR
Sonnich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top