1. date() 2015==115

There is no other word for it: naff.

It may have had a use 16+ years ago to make dd/mm/yy (ie a two digit year) a tad easier to print, but that has long since gone.

I think it is time to bite the bullet and say that date() returns the actual year, not minus 1900.

Yes, it will break some legacy code, but really if you see dd/mm/3915 you will instantly know precisely what is going on.

As it stands it marks out euphoria as some kind of inexplicably not yet extinct dinosaur.

Any other thoughts?

Pete

new topic     » topic index » view message » categorize

2. Re: date() 2015==115

Yep. Naff about sums it up. An honest assessment of what would actually break is probably in order if we were to actually fix it. In particular, I would be concerned with database code. Alternatively, a new date function could be a solution. Date() maybe? IDK.

new topic     » goto parent     » topic index » view message » categorize

3. Re: date() 2015==115

The datetime library addresses this problem. You can use datetime:now() instead of date().

include std/console.e 
include std/datetime.e 
 
datetime dt = datetime:now() 
display( datetime:format(dt) ) 
 
maybe_any_key() 

2015-09-14 08:52:37 

-Greg

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu