OneScript
  • Welcome to OneScript
  • OneScript Overview
    • Dates and Times
    • Sets
    • Types
    • Fields
      • Helper Fields
      • Labels
      • Standard Text
    • Snapshots
    • State Management
    • Future Features
  • Get OneScript
  • Macro Overview
    • Macro Virtual Machine
    • Code Instructions
  • Standard Libraries
    • Core
    • Data
    • Interview Model
  • Linker Overview
    • Objects
  • Contact Us
Powered by GitBook
On this page
  1. OneScript Overview

Dates and Times

Because OneScript is a researchers programming language dates and times are handled in a specific manner.

A basic date can be defined as follows:

0t2021-02-01

Where the year, month and day are defined in that order in the format yyyy-mm-dd. To make the date specific to a time zone add the following:

0t2021-02-01utc
0t2021-02-01gmt
0t2021-02-01+01:00

Adding the three letter time zone or the time difference based on the current utc, will help control how comparisons with the date are handled against other dates.

This approach means more when it comes to specifying times (either on their own or in combination with the date):

0t2021-02-01T01:02:34.000utc
0t2021-02-01T01:02:34.000+00:00
0t2021-02-01T01:02gmt
0t01:02:34.000utc

Date and Time Comparisons

Whilst dates and times can have a time zone associated with it, OneScript supports the idea of comparing dates and times either with the time zone or without. The benefit of this is all for validation for local time zones.

Consider the following; A respondent is asked to enter the time that they saw something. This will always be based in their local time zone.

PreviousOneScript OverviewNextSets

Last updated 3 years ago