how can I get the name of the day from Time.now
Time.now.day is a number I would like to for example Mon...
thx
|
|
0
|
|
|
|
Reply
|
michaelaugustyniak (57)
|
1/23/2006 11:21:58 PM |
|
misiek wrote:
> how can I get the name of the day from Time.now
> Time.now.day is a number I would like to for example Mon...
> thx
Hi misiek,
you can use strftime.
For example:
t = Time.now
puts t.strftime("%a") #=> Mon
puts t.strftime("%A") #=> Monday
ri strftime, will give you the complete list of options.
Cheers,
Antonio
--
Antonio Cangiano
My Ruby blog: http://www.antoniocangiano.com
|
|
0
|
|
|
|
Reply
|
acangianohatesspam (5)
|
1/23/2006 11:31:05 PM
|
|
Antonio Cangiano wrote:
> misiek wrote:
>
>> how can I get the name of the day from Time.now
>> Time.now.day is a number I would like to for example Mon...
>> thx
>
>
> Hi misiek,
> you can use strftime.
>
> For example:
>
> t = Time.now
> puts t.strftime("%a") #=> Mon
> puts t.strftime("%A") #=> Monday
>
> ri strftime, will give you the complete list of options.
>
> Cheers,
> Antonio
thank you it was super easy
|
|
0
|
|
|
|
Reply
|
michaelaugustyniak (57)
|
1/23/2006 11:50:13 PM
|
|
On Monday, January 23, 2006 6:50:13 PM UTC-5, misiek wrote:
> Antonio Cangiano wrote:
> > misiek wrote:
> >
> >> how can I get the name of the day from Time.now
> >> Time.now.day is a number I would like to for example Mon...
> >> thx
> >
> >
> > Hi misiek,
> > you can use strftime.
> >
> > For example:
> >
> > t = Time.now
> > puts t.strftime("%a") #=> Mon
> > puts t.strftime("%A") #=> Monday
> >
> > ri strftime, will give you the complete list of options.
> >
> > Cheers,
> > Antonio
>
>
> thank you it was super easy
Hi,
What do you mean by "ri strftime"? How do I get a complete list?
Thanks!
|
|
0
|
|
|
|
Reply
|
jared.flack (1)
|
7/10/2012 3:46:53 PM
|
|
On 10.07.2012 17:46, jared.flack@gmail.com wrote:
> What do you mean by "ri strftime"? How do I get a complete list?
More correctly "ri Time#strftime", for all methods see "ri Time".
Kind regards
robert
--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
|
|
0
|
|
|
|
Reply
|
shortcutter (5766)
|
7/10/2012 8:59:44 PM
|
|
|
4 Replies
52 Views
(page loaded in 0.075 seconds)
Similiar Articles: comp.lang.rubyget the name of the day from Time.now 4 20 (1/23/2006 11:21:58 PM) how can I get the name of the day from Time.now Time.now.day is a number I would like to for example Mon ... How to dynamically create filenames w/date/time stamps. - comp ...... the different pieces of your date/time stamp. For example: vDay =Day(Get ... should = 26-9-15.csv (month, day, hour) Now use ... Dynamically set variable name and value ... list file through filter by recent date - comp.lang.awknow i have to full script working here ... once > more filter it with the day - Second AWK line Yeah, I kinda get that ... by recent date - comp.lang.awk... get, say, the time ... plot time periods of hours a day - comp.soft-sys.matlabNow I'd like to plot for each 6 hours a day, that is 0-5 UTC 6-11 UTC 12-17 UTC ... WWVB signal to keep its own time ... several times during the work day. If you get ... AWK question - split string into variables - comp.unix.shell ...... begin time" Job will not start until after begin time begin time is in the form of month:day ... > > Scott All things considered and now that I know mktime() wouldn't ... How can I print logged on "user name" on printed records - comp ...I see the "User Name" and the User Name Symbol ... Allen www.semiotics.com FM7 Tip of the Day: The new security model is now ... Privacy Policy | All Times Are GMT(UTC) | ... Naming a new architecture - comp.compilers.lccArchitecture Now Building New Names - The New York Times ... Architecture firms are moving away from calling themselves by a slew of partner names and toward nomenclature ... nth day of the year? - comp.lang.awkhi, how can I get the number of today in the year? ... sec, A,B,C,D,ymd) { #convert a calendar date & time ... AWK (if in doubt, please always check the name of ... day of a ... False Reports of Leap-Seconds - comp.protocols.time.ntp... servers advertising the leap is almost zero now. ... that while some of the current RFCs say "current day ... All of them get time from either of two sets of peered ... Disable Error beep - comp.soft-sys.matlabThanks, news group, to sepdnign the time to decipher my ... So I typed the command the day I upgraded, and haven't ... On 7/11/2011 5:20 PM, Jessica Piper wrote: > > Ok now I ... The Time (band) - Wikipedia, the free encyclopediaThe Time (now The Original 7ven) is an American funk and dance-pop ensemble ... and hit singles "Jungle Love" and "The Bird" and were household names in 1984. It was Day who ... Names of the days of the week - Wikipedia, the free encyclopediaMS. 17 (now held at St. John's College, Oxford ... astrological forces", seven of which are used for day names ... Units of time; Days of the week; History of astronomy 7/29/2012 9:05:38 AM
|