Data-flo
Data-floSource CodeCGPS
  • INTRODUCTION
    • What is Data-flo
    • Getting Started - Sign In
    • Privacy and Terms Of Service
    • Contact - Help & reporting errors
    • Change log
  • USING DATA-FLO
    • Data-flo site navigation
      • Transformations Page
      • Run Page
      • Canvas
    • Data
      • Bringing data in to Data-flo
      • Getting data out of Data-flo
      • Data Types
        • Boolean
        • Datatable
        • File
        • Graph
        • List
        • Map
        • Number
        • Text
    • Regular Expressions (RegEx)
    • Adaptors overview
      • Components of an adaptor
      • Binding types
        • Bind to Data-flo input
        • Bind to value
        • Bind to another transformation
    • Specific adaptors
      • add-column
      • append-to-list
      • calculate-time-difference
      • change-column-case
      • columns-concatenation
      • concatenate-text
      • create-microreact-project
      • csv-file-to-datatable
      • csv-to-datatable
      • datatable-columns
      • datatable-to-csv-file
      • datatable-to-graph
      • datatable-to-list
      • datatable-to-map
      • datatable-to-sqlite-file
      • date-to-text
      • dbf-file
      • dot-to-graph
      • download-file
      • dropbox-file
      • epicollect-project
      • extend-datatable
      • figshare-file
      • file-to-text
      • filter-blank-values
      • filter-columns
      • filter-list
      • filter-rows
      • filter-rows-numerically
      • force-directed-layout
      • format-date-column
      • forward-geocoding
      • ftp-file
      • gather-rows
      • google-drive-file
      • google-spreadsheet
      • graph-to-dot
      • join-datatables
      • list-to-datatable
      • lookup-map-value
      • merge-datatables
      • merge-lists
      • microreact-project
      • mysql-database
      • newick-leaf-labels
      • oracle-database
      • postgress-database
      • prepend-to-list
      • remove-columns
      • remove-duplicate-rows
      • rename-columns
      • replace-blank-values
      • replace-column-values
      • replace-text
      • replace-text-in-list
      • replace-value
      • reverse-geocoding
      • row-column-value
      • s3-file
      • select-columns
      • send-email-message
      • slice-datatable
      • slice-list
      • smb-file
      • sort-datatable
      • sort-list
      • split-column
      • split-datatable-rows
      • split-list
      • split-text
      • spread-rows
      • spreadsheet-file
      • sql-server-database
      • sqlite-database
      • sum-rows
      • text-template
      • text-to-file
      • unique-list-items
      • update-epicollect-entries
      • update-microreact-project
      • update-smb-file
      • upload-file-to-google-drive
      • upload-files-to-google-drive
      • url-builder
      • yaml-to-json
    • Building a data-flo
      • Debugging mode
      • Show detailed errors on Run Page
      • Permissions - Access Control
    • Tips & Tricks
  • TUTORIALS
    • Prep outbreak data for Microreact
    • Common use cases, solved
      • Fixing datatable headers
      • Select, remove, rename, reorder columns
      • Data in separate files
      • There's no single-column unique row ID (primary key)
      • Ensure non-dates stay non-dates
      • Connect directly to a database
      • Access files on a drive
Powered by GitBook
On this page
  • Arguments
  • Date Formats
  • Example
  • Possible use cases

Was this helpful?

  1. USING DATA-FLO
  2. Specific adaptors

format-date-column

Define the format of a date-time column

Previousforce-directed-layoutNextforward-geocoding

Last updated 2 years ago

Was this helpful?

Define the format of a date-time column and either replace the original column values or add a new column with the reformatted date-time.

Arguments

Inputs:

data: The datatable containing a column of date values.

source column: The name of the column containing date-time values you want to reformat.

target column: The name of the column that will contain the formatted date-time values. If unspecified, it defaults to the 'source column' and will replace the original values.

Output:

data: A datatable containing formatted date values in the target column.

Date Formats

Example
Format symbols

2009-06-15T13:45:30.345

yyyy-MM-dd'T'HH:mm:ss.SSS

6/15/09

M/d/yy OR M/dd/yy

06/15/2009

MM/dd/yyyy

15-6-09

dd-M-yy

1:45 PM

hh:mm a

13:45

HH:mm

15 Jun 2009

dd LLL yyyy

Example

Output from Example data-flo (last column is reformatted)

Possible use cases

  • Standardize date-time formats across different columns with different formats.

  • Simplify date-time into simple date.

  • Reformat date to align with a new target audience.

source format: The format of the date-time values in the source column, based on Unicode Technical Standard #35. See . Defaults to ISO 8601.

target format: The desired format of the date-time values in the target column, based on Unicode Technical Standard #35. See . Defaults to yy-MM-dd. TIP: for Microreact projects, ISO 8601 is ideal (yyyy-MM-dd). Using this format Microreact will interpret it correctly and display in browsers using the local browser preferences.

locale: A language locale to be used when formatting the values. See or for a list of supported languages and locale options. If unspecified, locale defaults to 'en-GB'.

The table below shows some common formats. More information and other format symbols can be found on the .

https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
https://date-fns.org/v2.0.1/docs/I18n#supported-languages
https://github.com/date-fns/date-fns/tree/38ff3a18ad84d990b6ebcff1c120ea7ee4400b69/src/locale
Unicode site
Data-flo - Run: Adaptor Demo: format-date-column - Data-flo
Example data-flo (shown below)
Logo
Video showing example data-flo