Skip to content

Commit

Permalink
add datetime.datetime.today()
Browse files Browse the repository at this point in the history
  • Loading branch information
mreitinger committed Mar 10, 2024
1 parent 9f5a8b4 commit fe6dee0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions p5lib/Python2/Type/Object/StdLib/datetime/datetime.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ sub __print__ {
POSIX::strftime("%Y-%m-%d %H:%M:%S", shift->__posix__);
}

sub today { shift->now() }

sub now {
pop(@_); # default named arguments hash

Expand Down
3 changes: 3 additions & 0 deletions t/output-comparison-python-interpreter/stdlib-datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
d_reverse = datetime.datetime.strptime(d_formatted, format)
print d_reverse

today = datetime.datetime.today()
print today.strftime('%Y-%m-%d')

try:
datetime.datetime()
except:
Expand Down

0 comments on commit fe6dee0

Please sign in to comment.