Undefined method `now' for DateTime:Class (NoMethodError)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

e$BEDCf$5$s!"$U$J$P$5$s!"e(B

0% ruby -rtime -e ‘DateTime.now’

  • -e:1: undefined method `now’ for DateTime:Class (NoMethodError)

e$B$3$l$C$F$J$s$H$+$J$j$^$9$+$Me(B? datee$B$,FI$^$l$F$J$$$N$Ke(Btime ->
parsedate ->
date/[email protected]$1FI$^$l$F!"6u$Ne(BDateTimee$B!Je(BDatee$B$b!K$,Dj5A$5$l$F$k>uBV$_$?$$e(B
e$B$G$9!#e(B

RubyGemse$B$N&B!Je(B0.9.4.5e$B!K0J9_!"%@%$%(%C%H$K$h$je(Brubygemse$B$,e(Bdatee$B$rFI$^$J$/$J$Ce(B
e$B$?$s$G$9$,!"$=$l$G%3%1$ke(BRakefilee$B!Je(Bruby-profe$B!“e(Bruby-debuge$B!K$,$$$/$D$+$”$Ce(B
e$B$F5$IU$-$^$7$?!#e(B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRx3UfR9L2jg5EEGlAQLJBwf/bRzA3n5UyLGkLiruczo5SLbLrJvPiExM
hK5vcfdqVqnSonSP9rEE3J8xYI1Igbgv1SiYZ5sHdwOqSXpbtUEB90mgj8zdU0A+
E98Y16egEZKC2CBibKFGF5pp0oECMONBWfb1muBr4iFqSjDLIbdhMEIoZGm9Fitp
PSN3aWgGrz3faNYQ3pdHuh9YrYfGyyL0vQK865Ex2KcT+Bpn+qyREf+ZZ1pMjvrP
DUpD+nPnQM2z1enmnorpxPr56bjRslzn8yeJsNDK5Lrt4KsE5EhuFLNpBY7xSL/M
agkfrUx5fcp/+4iwB3wnf3amvXlhAMSwSYgOzRuijnwTNOx9pFkuhA==
=cX/M
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

NAKAMURA, Hiroshi wrote:

0% ruby -rtime -e ‘DateTime.now’
-e:1: undefined method `now’ for DateTime:Class (NoMethodError)

e$B$3$l$C$F$J$s$H$+$J$j$^$9$+$Me(B? datee$B$,FI$^$l$F$J$$$N$Ke(Btime -> parsedate ->
date/[email protected]$1FI$^$l$F!"6u$Ne(BDateTimee$B!Je(BDatee$B$b!K$,Dj5A$5$l$F$k>uBV$_$?$$e(B
e$B$G$9!#e(B

e$B$9$$$^$;$s!"e(Bruby 1.8.6 (2007-10-15 patchlevel 5000) [i686-linux]
e$B$G$9!#e(B
[email protected]$H$A$g$C$H%a%C%;!<%8$,0c$$$^$9$,!"F1$8$h$&$Ke(BNoMethodErrore$B$G$9$M!#e(B

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRx3VbR9L2jg5EEGlAQIhcAf6AwRcsCG9t9Lwo3DiDWqb2GO4QWzjoIFl
coRMjDZQcEk/ZbcgqOr/19eTh28U068J1lbWpd9dpf2eAkWDJnUWLmmFIY5vyhdJ
7p3FrHeyBdW2qqJm/yI9yhXWBOcezYpW/d9tqrn08yH8o/u/QrMM2YozjNkHrLq7
XLhmUZQxkFh67MjM9JEr9rLcfh4IBdeYaWjuvYImChcvV/pKl1wrLV5mzFaYicF1
0Gno0mTXRNPMMjmFqHoHWd058RJIW+9mdUjcTWF+ue+RwKsqZ6cbrrNZ/6vqTTTn
uZMLI/KuV70XF0mlGWBE3fwen809PgH67N6w4dQG1NnwnVB2s1EX/Q==
=VPFz
-----END PGP SIGNATURE-----

e$B$I$&$$$&>u67$+$h$/$o$+$C$F$J$$$N$G$9$,!"$$$C$=I,$:e(B date
e$B4]$4$HFI$`$h$&$K$9$k$+!“e(B
e$BJL$NL>A06u4V$rMQ0U$9$k!”$H$+$7$?$[$&$,$$$$$G$9$+$M!#e(B

Time.parse e$B$,e(B NoMethodError
e$B$K$J$k$H$-$H!"$=$&$G$J$$$H$-$H$"$k$N$be(B
e$B;w$F$$$k$h$&$J5$$,$9$k$N$G$9$,!#e(B
e$B<B:]!“e(Brails e$B$”$?$j$+$i;O$a$??M$O4*0c$$$7$F$$$k?M$bB?$=$&!#e(B

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[email protected] wrote:

e$B$I$&$$$&>u67$+$h$/$o$+$C$F$J$$$N$G$9$,!"$$$C$=I,$:e(B date e$B4]$4$HFI$`$h$&$K$9$k$+!“e(B
e$BJL$NL>A06u4V$rMQ0U$9$k!”$H$+$7$?$[$&$,$$$$$G$9$+$M!#e(B

e$B$b$7$+$7$F!"C1$Ke(Btime.rbe$B$N!Ve(Brequire
'parsedate’e$B!W$r:[email protected][email protected]$C$?$je(B
e$B$7$^$;$se(B?

Time.parse e$B$,e(B NoMethodError e$B$K$J$k$H$-$H!"$=$&$G$J$$$H$-$H$"$k$N$be(B
e$B;w$F$$$k$h$&$J5$$,$9$k$N$G$9$,!#e(B

e$B$=$&$G$9$M!#e(Brequire
'time’e$B$NM-L5$K$h$j!"e(BTimee$B$N5sF0$,JQ$o$k!#e(B
require 'date’e$B$NM-L5$K$h$j!"e(BDatee$B$N5sF0$,JQ$o$k!#e(B

[email protected](BDateTimee$B$K4X$7$F$O!“e(Brequire
'date’e$B$,$J$$8B$j!“K\Mhe(BDateTimee$B$OB8:_$7$Je(B
e$B$$!”$H$$$&$”$?$j$,HyL/$K0c$&5$$,$7$^$9!#e(B

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRx35tB9L2jg5EEGlAQIjBggArevaGt7h+tIF9Le333z2k/6NzzJpjG4X
zFLeERedH9T4BEBoD4MzWKrBq5aBSIz721qrJkTnSMEt+RF37VIXBaq22Lg4304b
9GpvQcqFadZlb3XuJf8y0UITgddDILOswJuOxVbWvisRLIcAmrzRpJ/RdDiP8reB
8wr/O9gY/vS0KNPbgwNMIOiHRAZIQ5TSqmNyC3X4RoNMZqU8cUhgLmxX2LvmeX0E
/PVwBSuZB/u+waEtpjeDJH1yxPGYhb9pQSCS3GCMglAV7qfEC4Qw+R+orjSAg0wp
SzUzycMeErvuM9yVYLY4B6NGXZQwnMOPEhxtQKjw+Nn3Lg13FmnTtw==
=kJz7
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[email protected] wrote:

e$B$b$7$+$7$F!"C1$Ke(Btime.rbe$B$N!Ve(Brequire 'parsedate’e$B!W$r:[email protected][email protected]$C$?$je(B
e$B$7$^$;$se(B?

e$B$=$l$,$G$-$k$N$+H=$j$^$;$s$,!"e(Brequire ‘parsedate’ [email protected]$H;W$$$^$9!#e(B

e$B3N$+$K!#$G!“e(B1.9e$B$Ge(Bparsedate.rbe$B$,$J$/$J$k$3$H$r9M$($k$H!”$H$j$"$($:e(Btime.rb
e$B$+$ie(Bparsedate.rbe$B0MB8$r30$;$k$N$J$i!"[email protected]$1$NBP1~$G$h$$$H;W$$$^$9!#e(B

e$B:G6a$O$$s$J2?$re(B require e$B$7$m$H$+!"$=$&$$$&$3$H$O$"$^[email protected]$o$J$$$7!“e(B
e$B5$$K$7$F$$$J$$$h$&$J5$$,$7$^$9!#e(B
Time.parse e$B$r;H$$$?$+$C$?$i!“e(Brequire ‘time’ e$B$7$m$H$$$&$N$O!”$b$&DLMQ$7$J$/$J$j$D$De(B
e$B$”$k$N$+$b$7$l$J$$$N$G!"e(Btime.rb e$B$b$J$/$7$F$
$k$H$+!#e(B

time.rbe$B$NFbMF$rAH$9~$$K$9$k$H$$$&$3$H$G$9$h$M!#A4Ite(BCe$B$G=q$-D>$5$J$$$H$$e(B
e$B$1$J$$$N$G!"$=$l$O87$7$$$s$8$c$J$$$+$J!#e(Bthread.rbe$B$HF1$8$G!"0lIt$N3HD%$Oe(B
[email protected]@$,I,MW$H$$$&$N$O;D$7$F$b$$$$$H;W$$$^$9!#e(B

e$B=>Mh$O!“e(BRaile$B$de(BRubyGemse$B$,7k9=BgNL$K$”$l$3$le(Brequiree$B$7$F$$$k$?$a!"%"%W%j=qe(B
e$B$-$K$H$C$F$O!V2?$b$7$J$/$F$b;H$($F$?!W$H$$$&>u67$,B?$$$s$8$c$J$$$+$H;W$$e(B
e$B$^$9!#e(BRubyGemse$B$N%@%$%(%C%H$K$h$j!"B>$K$b$$$/$D$+!"e(Brequiree$B$7$F$J$/$Fe(B
NameErrore$B$H$$$&LdBj$,0z$-5/$3$5$l$k$s$8$c$J$$$+$J!#e(B

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRx6Z4h9L2jg5EEGlAQIHygf+PjMlT7QnjyDHGiMjd6YBZibxD5m3V2OE
SxGSRIaOtGuzn3ROeYDht1kcp6qy2/NpkYmw4oJGUA9zdYjkRetU0u0F/hshOLhG
mxDZZo6gaEx8WVXj/Sx33cR6pH4RLMb5UA9OFPxoTR/6v3hsW65YAOieCNbCZ2go
ss4eATZFx1SxLnNSETT9utj7CcVOi0OmhDnmBo4OD5qfyZ3Kraq9Zf8KZ+tFQAe7
/LEakOtC/yMuBWcSmHHwxQS3lA3YgwQ3JMOf/nvN1MvO/ZQCZtRyYNtzq8meKKGG
5BKx7UNW2XpsdHK7jWY0Bq6oWHm08NVwrw6IyQ6EVrJ/+Cq2k+/F/A==
=6koZ
-----END PGP SIGNATURE-----

e$B3N$+$K!#$G!“e(B1.9e$B$Ge(Bparsedate.rbe$B$,$J$/$J$k$3$H$r9M$($k$H!”$H$j$"$($:e(Btime.rb
e$B$+$ie(Bparsedate.rbe$B0MB8$r30$;$k$N$J$i!"[email protected]$1$NBP1~$G$h$$$H;W$$$^$9!#e(B

1.9 e$B$G$be(B date/format.rb
e$B$rD>@;2>[email protected]$1$8$c$J$$$+$H;W$&$s$G$9$,!"e(B
e$BEDCf$5$s$N$[$&$GBP1~$G$-$k$N$J$i$=$l$G$$$$$H;W$$$^$9!#e(B

time.rbe$B$NFbMF$rAH$9~$$K$9$k$H$$$&$3$H$G$9$h$M!#A4Ite(BCe$B$G=q$-D>$5$J$$$H$$e(B
e$B$1$J$$$N$G!"$=$l$O87$7$$$s$8$c$J$$$+$J!#e(Bthread.rbe$B$HF1$8$G!"0lIt$N3HD%$Oe(B
[email protected]@$,I,MW$H$$$&$N$O;D$7$F$b$$$$$H;W$$$^$9!#e(B

python e$B$G$Oe(B C e$B$G=q$+$l$?%3!<%I$+$ie(B python e$B$G=q$+$l$?e(B
strptime e$B$r;2>H$7$?$je(B
e$B$9$k$N$r8+$?$3$H$,$"$j$^$9$,!“e(Bruby
e$B$G$O$”$^$j$=$&$$$&$3$H$O$7$^$;$s$M!#e(B

In article
[email protected],
[email protected] writes:

1.9 e$B$G$be(B date/format.rb e$B$rD>@;2>[email protected]$1$8$c$J$$$+$H;W$&$s$G$9$,!"e(B
e$BEDCf$5$s$N$[$&$GBP1~$G$-$k$N$J$i$=$l$G$$$$$H;W$$$^$9!#e(B

e$B$($’$H!"e(B1.9 e$B$Ne(B time.rb e$B$Oe(B require ‘date/format’
e$B$7$F$$$^$9$,!"e(B
e$B$3$l$re(B require ‘date’ [email protected]$H$$$&$3$H$G$9$+e(B?

time.rb e$B<+?H$Oe(B date/format.rb e$B$,Ds6!$9$kItJ,$7$+;H$C$F$$$J$$e(B
e$B$N$G$9$,!#e(B

e$B$b$7$+$7$F!"C1$Ke(Btime.rbe$B$N!Ve(Brequire 'parsedate’e$B!W$r:[email protected][email protected]$C$?$je(B
e$B$7$^$;$se(B?

e$B$=$l$,$G$-$k$N$+H=$j$^$;$s$,!"e(Brequire ‘parsedate’
[email protected]$H;W$$$^$9!#e(B

Time.parse e$B$,e(B NoMethodError e$B$K$J$k$H$-$H!"$=$&$G$J$$$H$-$H$"$k$N$be(B
e$B;w$F$$$k$h$&$J5$$,$9$k$N$G$9$,!#e(B

e$B$=$&$G$9$M!#e(Brequire 'time’e$B$NM-L5$K$h$j!"e(BTimee$B$N5sF0$,JQ$o$k!#e(B
require 'date’e$B$NM-L5$K$h$j!"e(BDatee$B$N5sF0$,JQ$o$k!#e(B

[email protected](BDateTimee$B$K4X$7$F$O!“e(Brequire 'date’e$B$,$J$$8B$j!“K\Mhe(BDateTimee$B$OB8:_$7$Je(B
e$B$$!”$H$$$&$”$?$j$,HyL/$K0c$&5$$,$7$^$9!#e(B

Time e$B$OAH$9~$$G$9$7$M!#e(B
e$B$J$$$J$i$J$$!"$"$k$J$i$9$Y$F$"$k!"$H$$$&$U$&$K$G$-$l$P$o$+$j0W$$$G$9$M!#e(B

e$B:G6a$O$$s$J2?$re(B require
e$B$7$m$H$+!"$=$&$$$&$3$H$O$"$^[email protected]$o$J$$$7!“e(B
e$B5$$K$7$F$$$J$$$h$&$J5$$,$7$^$9!#e(B
Time.parse e$B$r;H$$$?$+$C$?$i!“e(Brequire ‘time’
e$B$7$m$H$$$&$N$O!”$b$&DLMQ$7$J$/$J$j$D$De(B
e$B$”$k$N$+$b$7$l$J$$$N$G!"e(Btime.rb e$B$b$J$/$7$F$
$k$H$+!#e(B

e$B$($’$H!"e(B1.9 e$B$Ne(B time.rb e$B$Oe(B require ‘date/format’ e$B$7$F$$$^$9$,!"e(B
e$B$3$l$re(B require ‘date’ [email protected]$H$$$&$3$H$G$9$+e(B?

e$BKM$OI,$:$7$b$=$&[email protected]$H$O;W$$$^$;$s$,!"$?$V$s!"e(B
e$B$=$&$$$&$3$H$rK>$^$l$F$$$k$N$G$O$J$$$G$7$g$&$+!#e(B

time.rb e$B<+?H$Oe(B date/format.rb e$B$,Ds6!$9$kItJ,$7$+;H$C$F$$$J$$e(B
e$B$N$G$9$,!#e(B

parsedate e$B$bF1MM$NM}M3$G$=$&$7$F$$$^$7$?!#e(B
[email protected]!"$"$^$j$h$/$J$$$N$O$?$7$+$+$J$H$O;W$$$^$9!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:32137] Re: undefined method `now’ for
DateTime:Class (NoMethodError)”
on Tue, 23 Oct 2007 23:54:11 +0900, [email protected] writes:

|Time.parse e$B$r;H$$$?$+$C$?$i!“e(Brequire ‘time’ e$B$7$m$H$$$&$N$O!”$b$&DLMQ$7$J$/$J$j$D$De(B
|e$B$"$k$N$+$b$7$l$J$$$N$G!"e(Btime.rb e$B$b$J$/$7$F$_$k$H$+!#e(B

e$B$A$g$C$HFI$_<h$l$J$+$C$?$N$G$9$,!"e(Btime.rbe$B$r$J$/$7$?>l9g!"e(B
Time.parsee$B$,$I$&$J$k$3$H$rA[Dj$7$F$$$k$N$G$9$+!)e(B

  • Time.parsee$B$OAH$9~$$Ke(B
  • Time.parsee$B$O$J$/$J$ke(B
  • e$B$=$NB>e(B

In article
[email protected],
[email protected] writes:

e$B$($’$H!"e(B1.9 e$B$Ne(B time.rb e$B$Oe(B require ‘date/format’ e$B$7$F$$$^$9$,!"e(B
e$B$3$l$re(B require ‘date’ [email protected]$H$$$&$3$H$G$9$+e(B?

e$BKM$OI,$:$7$b$=$&[email protected]$H$O;W$$$^$;$s$,!"$?$V$s!"e(B
e$B$=$&$$$&$3$H$rK>$^$l$F$$$k$N$G$O$J$$$G$7$g$&$+!#e(B

e$B9M$($?$s$G$9$,!"$3$l$r9T$&$3$H$Oe(B RubyGems e$B$N%@%$%(%C%H$NEXNOe(B
e$B$K5U9T$9$k$N$G!"$7$J$$$N$,E,@Z$G$"$k$h$&$K;W$$$^$9!#e(B

e$B$A$g$C$HFI$_<h$l$J$+$C$?$N$G$9$,!"e(Btime.rbe$B$r$J$/$7$?>l9g!"e(B
Time.parsee$B$,$I$&$J$k$3$H$rA[Dj$7$F$$$k$N$G$9$+!)e(B

  • Time.parsee$B$OAH$9~$$Ke(B
  • Time.parsee$B$O$J$/$J$ke(B
  • e$B$=$NB>e(B

e$BAH$9~$$K$J$k$N$G$7$g$&$+!#e(B
require ‘time’ e$B$7$J$/$F:Q$`$h$&$K$9$k!"$H$$$&$3$H$G$9$M!#e(B

[email protected]$H$=$&$$$&0U8+$b$"[email protected]$m$&$H;W$C$F!"[email protected]$C$F$_$^$7$?!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs