Problem with format string in datetime_format()


I am using datetime_format to format a vertex’s datetime attribute to a string that is written to a file with println(). It generally works, but the issue is that %Y-%m-%d does not seem to obey the standard conventions in other languages - i.e. the month and day are not prepended with 0s (2020-4-1). Given c++ is the basis for Tigergraph, this is unexpected… I want to say it shouldn’t be doing this - if I’m overlooking something, please let me know.


1 Like

That’s a bug. We should support ISO 8601. I’ll open a JIRA. It may not be the highest priority I’m afraid, and we may suffer from people already adapting to the bug so I can’t guarantee a fix any time soon. Sorry about that.

The workaround, which I know is far from ideal, is to define a UDF (C++ yay), or a subquery string munger in GSQL.

The latter will work for relatively latency insensitive applications. If you are blocked (or this gets some votes), let us know and I’ll get an elf to write the subquery and post it here!

thanks for the reply. It is fine for now; these reports are just for me. It was not clear from the documentation whether all of the usual formatting options were available (e.g. everything associated with strftime) so it would be nice to have all that supported.