[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

timestamp

Sunny Bogawat

5/7/2008 9:09:00 AM

i want attaches a timestamps to file for this i doing Time.now_filename
but it gives error because time has a space sum it so i need some
another mechanism using which i generate timestamps and attached to
timestamps.
--
Posted via http://www.ruby-....

1 Answer

Axel Etzold

5/7/2008 9:59:00 AM

0

Dear Sunny,
-------- Original-Nachricht --------
> Datum: Wed, 7 May 2008 18:09:03 +0900
> Von: Sunny Bogawat <sunny_bogawat@neovasolutions.com>
> An: ruby-talk@ruby-lang.org
> Betreff: timestamp

> i want attaches a timestamps to file for this i doing Time.now_filename
> but it gives error because time has a space sum it so i need some
> another mechanism using which i generate timestamps and attached to
> timestamps.
> --
> Posted via http://www.ruby-....

maybe you attach Time.now.to_s.gsub(/ /,'_') ?
There are also methods to extract the day, the hour or the second from a
Time object:

www.ruby-doc.org/core/classes/Time.html

Best regards,

Axel

--
249 Spiele für nur 1 Preis. Die GMX Spieleflatrate schon ab 9,90 Euro.
Neu: Asterix bei den Olympischen Spielen: http://flat.ga...