Opened 2 years ago
Last modified 2 years ago
#22778 new enhancement
reconsider mapcss function osm_timestamp()
Reported by: | Klumbumbus | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core mappaint | Version: | |
Keywords: | Cc: | mikeho |
Description
For https://www.openstreetmap.org/api/0.6/node/4471457459 the mapcss function osm_timestamp()
returns an integer number (1477838904) which is not really useful I guess.
It would be better if it would return the human readable format (2016-10-30T14:48:24Z)
Attachments (0)
Change History (5)
comment:1 by , 2 years ago
Cc: | added |
---|
comment:2 by , 2 years ago
comment:4 by , 2 years ago
JOSM, Window: "History for way/node <number>" ( Ctrl + h ) shows the text "Version 3 created on 1/20/20 6:16 PM". This is more understandable for humans than "Version 3 created on 1615578551". In a MapCSS it is the same. That's why we need a function that outputs the osm_timestamp as a formatted string, for example osm_timestamp_formated_string() ( like the strftime() function ).
The format "2016-10-30T14:48:24Z" can be an alternative to national date formats like "30.10.2023, 14:48:24 Z".
node[...]::layer_xyz { ... text: concat("Last edit by ", osm_user_name(), " on ", osm_timestamp_formated_string() ); ... }
The result "Last edit by mikeho on 2016-10-30T14:48:24Z" is easy to understand. "Last edit by mikeho on 161030123" says nothing to humans.
comment:5 by , 2 years ago
Replying to stoecker:
Why is the integer not helpful?
For "human reading" it is useless. If it can be used for sorting or something like that, then 2 functions would be the best.
If this change is made, we'd probably want to be able to parse timestamp values as well, e.g.
I don't think we currently do so.