Redivis Documentation
API DocumentationRedivis Home
  • Introduction
  • Redivis for open science
    • FAIR data practices
    • Open access
    • Data repository characteristics
    • Data retention policy
    • Citations
  • Guides
    • Getting started
    • Discover & access data
      • Discover datasets
      • Apply to access restricted data
      • Create a study
    • Analyze data in a workflow
      • Reshape data in transforms
      • Work with data in notebooks
      • Running ML workloads
      • Example workflows
        • Analyzing large tabular data
        • Create an image classification model
        • Fine tuning a Large Language Model (LLM)
        • No-code visualization
        • Continuous enrollment
        • Select first/last encounter
    • Export & publish your work
      • Export to other environments
      • Build your own site with Observable
    • Create & manage datasets
      • Create and populate a dataset
      • Upload tabular data as tables
      • Upload unstructured data as files
      • Cleaning tabular data
    • Administer an organization
      • Configure access systems
      • Grant access to data
      • Generate a report
      • Example tasks
        • Emailing subsets of members
    • Video guides
  • Reference
    • Your account
      • Creating an account
      • Managing logins
      • Single Sign-On (SSO)
      • Workspace
      • Studies
      • Compute credits and billing
    • Datasets
      • Documentation
      • Tables
      • Variables
      • Files
      • Creating & editing datasets
      • Uploading data
        • Tabular data
        • Geospatial data
        • Unstructured data
        • Metadata
        • Data sources
        • Programmatic uploads
      • Version control
      • Sampling
      • Exporting data
        • Download
        • Programmatic
        • Google Data Studio
        • Google Cloud Storage
        • Google BigQuery
        • Embedding tables
    • Workflows
      • Workflow concepts
      • Documentation
      • Data sources
      • Tables
      • Transforms
        • Transform concepts
        • Step: Aggregate
        • Step: Create variables
        • Step: Filter
        • Step: Join
        • Step: Limit
        • Step: Stack
        • Step: Order
        • Step: Pivot
        • Step: Rename
        • Step: Retype
        • Step: SQL query
        • Variable selection
        • Value lists
        • Optimization and errors
        • Variable creation methods
          • Common elements
          • Aggregate
          • Case (if/else)
          • Date
          • DateTime
          • Geography
          • JSON
          • Math
          • Navigation
          • Numbering
          • Other
          • Statistical
          • String
          • Time
      • Notebooks
        • Notebook concepts
        • Compute resources
        • Python notebooks
        • R notebooks
        • Stata notebooks
        • SAS notebooks
        • Using the Jupyter interface
      • Access and privacy
    • Data access
      • Access levels
      • Configuring access
      • Requesting access
      • Approving access
      • Usage rules
      • Data access in workflows
    • Organizations
      • Administrator panel
      • Members
      • Studies
      • Workflows
      • Datasets
      • Permission groups
      • Requirements
      • Reports
      • Logs
      • Billing
      • Settings and branding
        • Account
        • Public profile
        • Membership
        • Export environments
        • Advanced: DOI configuration
        • Advanced: Stata & SAS setup
        • Advanced: Data storage locations
        • Advanced: Data egress configuration
    • Institutions
      • Administrator panel
      • Organizations
      • Members
      • Datasets
      • Reports
      • Settings and branding
    • Quotas and limits
    • Glossary
  • Additional Resources
    • Events and press
    • API documentation
    • Redivis Labs
    • Office hours
    • Contact us
    • More information
      • Product updates
      • Roadmap
      • System status
      • Security
      • Feature requests
      • Report a bug
Powered by GitBook
On this page
  • Current date
  • New date
  • Date add
  • Date diff
  • Date subtract
  • Date truncate
  • Date extract
  • Format date
  • Parse date

Was this helpful?

Export as PDF
  1. Reference
  2. Workflows
  3. Transforms
  4. Variable creation methods

Date

Last updated 1 year ago

Was this helpful?

Current date

Returns the current date –>

CURRENT_DATE([@time_zone])

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@time_zone

any of: ACDT, ACST, ACT, ACT, ACWST, ADT, AEDT, AEST, AFT, AKDT, AKST, AMST, AMT, AMT, ART, AST, AST, AWST, AZOST, AZOT, AZT, BDT, BIOT, BIT, BOT, BRST, BRT, BST, BST, BST, BTT, CAT, CCT, CDT, CDT, CEST, CET, CHADT, CHAST, CHOT, CHOST, CHST, CHUT, CIST, CIT, CKT, CLST, CLT, COST, COT, CST, CST, CST, CT, CVT, CWST, CXT, DAVT, DDUT, DFT, EASST, EAST, EAT, ECT, ECT, EDT, EEST, EET, EGST, EGT, EIT, EST, FET, FJT, FKST, FKT, FNT, GALT, GAMT, GET, GFT, GILT, GIT, GMT, GST, GST, GYT, HDT, HAEC, HST, HKT, HMT, HOVST, HOVT, ICT, IDLW, IDT, IOT, IRDT, IRKT, IRST, IST, IST, IST, JST, KALT, KGT, KOST, KRAT, KST, LHST, LHST, LINT, MAGT, MART, MAWT, MDT, MET, MEST, MHT, MIST, MIT, MMT, MSK, MST, MST, MUT, MVT, MYT, NCT, NDT, NFT, NPT, NST, NT, NUT, NZDT, NZST, OMST, ORAT, PDT, PET, PETT, PGT, PHOT, PHT, PKT, PMDT, PMST, PONT, PST, PST, PYST, PYT, RET, ROTT, SAKT, SAMT, SAST, SBT, SCT, SDT, SGT, SLST, SRET, SRT, SST, SST, SYOT, TAHT, THA, TFT, TJT, TKT, TLT, TMT, TRT, TOT, TVT, ULAST, ULAT, UTC, UYST, UYT, UZT, VET, VLAT, VOLT, VOST, VUT, WAKT, WAST, WAT, WEST, WET, WIT, WST, YAKT, YEKT

false

(UTC (default))

New date

Constructs a date from a year, month, and day –>

DATE(@year, @month, @day)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@year

true

-

@month

true

-

@day

true

-

Date add

DATE_ADD(@date_expression, INTERVAL @integer_expression @date_part)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@integer_expression

true

-

@date_part

any of: year, month, quarter, week, day

true

((e.g., days))

@date_expression

true

-

Date diff

DATE_DIFF(@date_expression, @date_expression_2, @date_part)

Return type

integer

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_expression_2

true

-

@date_expression

true

-

@date_part

any of: day, week, month, quarter, year

true

((e.g., days))

Date subtract

DATE_SUB(@date_expression, INTERVAL @integer_expression @date_part)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@integer_expression

true

-

@date_part

any of: day, week, month, quarter, year

true

((e.g., days))

@date_expression

true

-

Date truncate

DATE_TRUNC(@date_expression, @date_truncate_part)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_expression

true

-

@date_truncate_part

any of: day, month, quarter, year, week(sunday), week(monday), week(tuesday), week(wednesday), week(thursday), week(friday), week(saturday), ISOquarter, ISOyear

true

((e.g., month))

Date extract

EXTRACT(@date_part FROM @date_expression)

Return type

integer

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_part

any of: DAYOFWEEK, DAY, DAYOFYEAR, WEEK, MONTH, QUARTER, YEAR, ISOWEEK, ISOYEAR

true

((e.g., month))

@date_expression

true

-

Format date

FORMAT_DATE(@format_string, @date_expression)

Return type

string

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_expression

true

-

@format_string

true

(e.g., %Y-%m-%d)

Parse date

[@safe]PARSE_DATE(@format_string, @date_string)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_string

true

-

@format_string

true

(e.g., %Y-%m-%d)

@safe

true

-

or

any

or

any

or

any

Add a period of time to a date –>

or

any

or

any

Calculate the distance between two dates –>

or

any

or

any

Subtract a period of time from a date –>

or

any

or

any

Truncates a date to the nearest boundary –>

or

any

Extracts the date part (e.g, month) from a date –>

or

any , ,

Returns a formatted string from a date –>

or

any

any

More details about format strings

Parses a date from a string –>

or

any

any

any

More details about format strings

learn more
learn more
learn more
learn more
learn more
learn more
learn more
learn more
here
learn more
here
enum
variable
literal
integer
variable
literal
integer
variable
literal
integer
variable
literal
integer
enum
variable
literal
date
variable
literal
date
variable
literal
date
enum
variable
literal
integer
enum
variable
literal
date
variable
literal
date
enum
enum
variable
literal
date
dateTime
time
variable
literal
date
literal
string
variable
literal
string
literal
string
boolean
boolean