Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 19th, 2000, 04:03 PM
scream scream is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 441 scream User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 59 m 38 sec
Reputation Power: 9
Send a message via ICQ to scream
($atime, $mtime) = (stat($path))[8,9];

$mtime now contains some huge number of seconds somehow relating to when the file specified by $path was last modified. How can I take $mtime and format it to MONTH DAY, YEAR?

Thanks!

[This message has been edited by scream (edited July 19, 2000).]

Reply With Quote
  #2  
Old July 20th, 2000, 05:05 AM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Try using something like localtime(). Chek the man pages for further info.

Reply With Quote
  #3  
Old July 20th, 2000, 07:30 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 9
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan

Try the following..Modify as per your requirment..


($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime($mtime);

@months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

$year = $year + 1900;
$date = "$months[$mon]- $mday - $year";

print $date;

-----------------


------------------
SR -
webshiju.com

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > timestamps


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway