CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
TIME() Usuage

 



gigatron
Deleted

Aug 4, 2000, 8:56 AM

Post #1 of 3 (508 views)
TIME() Usuage Can't Post

I want to get the time value from time for a given date. Not the localtime or GMtime. I want to use a date I select and get the a value for that date. I need a constant to compare give dates with. I do not wish to use a module.
Can I use
time()
How do I get my own time value in there?

------------------
Gigatron

[This message has been edited by gigatron (edited 08-04-2000).]


dws
Deleted

Aug 4, 2000, 3:45 PM

Post #2 of 3 (508 views)
Re: TIME() Usuage [In reply to] Can't Post

I'd say use Date::Manip or Date::Calc, but if you really, really don't want to use a module, you best bet may be to find the routines in those modules that do what you need, and copy them.


randor
User

Aug 5, 2000, 10:56 AM

Post #3 of 3 (509 views)
Re: TIME() Usuage [In reply to] Can't Post

Gigatron,
im with you, modules are a waste of resources, and (time)pun intended Smile

the standard time function is as follows:

This is a sub directly out of one of my scripts:

sub settime {
($second, $minute, $hour, $dayofmonth, $month, $year, $weekday, $dayofyear, $isdst)= localtime(time);
@mnth = ('January' ,'Febuary' ,'March' ,'April', 'May' ,'June' ,'July' ,'August' ,'September', 'October', 'November', 'December');
@dwk= ('Sunday','Monday','Tuesday','Wednesday','Thirsday','Friday','Saturday','Sunday');
$realmonth = @mnth[$month];
$realday = @dwk[$weekday];
$shortyear = ($year % 100);
if ($hour > 12) {
$hour = ($hour - 12);
$tu = 'pm';}else {$tu = 'am'}
return "$realday, $realmonth $dayofmonth 200$shortyear $hour:$minute:$second$tu";
}

this will return example:

Saturday, August 8 2000 6:41:23am

hope this helps,
Randor


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives