Feature - Rejected Switch order of date_to_timestamp() parameters?

Aventuristo

Member
I'm not sure how to classify this, so I'll just phrase it as a question. I'm glad that int date_to_timestamp( string, string ) and string timestamp_to_date( int, string ) have been added to Ash. However, the format string parameter is second in timestamp_to_date() and first in date_to_timestamp(). Question: could the parameters be switched around in date_to_timestamp() for consistency? As it is now, I can do something like get_timestamp_from_somewhere().timestamp_to_date(format_string), but I can't do get_date_string_from_somewhere().date_to_timestamp(format_string).

What do y'all think? Is there some reason I'm missing for the format string to be first?
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Both functions are ordered like that to be consistent with format_date_time (i.e. one is the first two params and the other is the last two params)
 

Aventuristo

Member
That would be a reason I was missing. I wouldn't have ordered format_date_time that way either ("convert A from format B to format C" = format_date_time(B, A, C)? ), but the function is 9 years old, and I must accept it. Thanks, Gausie, for the explanation.
 
Top