google-cloud-platformgoogle-workflows

Creating Timestamp in Google Workflow YAML


Trying to create a file output with date extension yyy-mm-dd etc. Cloud workflow does not have the date format functions of bigquery.
Closet I could get is ${time.format(sys.now())}, but that provides a timestamp. Any way to parse to required format.


Solution

  • I suppose you mean a date extension in this format yyyy-mm-dd (your question says yyy-mm-dd).

    ${time.format(sys.now())} is giving me a timestamp like this: 2022-10-22T18:39:05.570539Z

    With the text.substring() function ${text.substring(time.format(sys.now()), 0, 10)} I'm getting this string: 2022-10-22