DateAndTime

Overview

This namespace contains functions that deal with date and time.

Note that most of the functions have been implemented by Phil Last (http://aplwiki.com/PhilLast) - unless stated otherwise - and generously granted to the APLTree project.

This class does not need .NET.

Examples

The following table gives examples for all functions. The table is ordered by categories.

Note that not all syntactically possible features are demonstrated by these examples. For details execute:

      ]ADOC_Browse #.DateAndTime

(What is ADOC?) (What is the ADOC user command?)

Result

Function

Cast

735965.058159722

DateTime2DayDecimal

20160102.012345

20160102.012345

DayDecimal2DateTime

735965.058159722

24193

DateTime2Month

20160102.058159722

20160101

Month2DateTime

24193

2016 1 1 1 23 45 0

DateTime2Timestamp

20160101.012345

20160101.012345

Timestamp2DateTime

2016 1 1 1 23 45

2016 1 2 1 23 44 999

DayDecimal2Timestamp

735965.058159722

735965.058148148

Timestamp2DayDecimal

2016 1 2 1 23 44

736329

Date2GregorianSerialDate

2016 12 31

2016 12 31

GregorianSerialDate2Date

736329

Week numbers

52

WeekNo_ISO

2016 12 31

2016 12 26

DateFrom_Year_WeekNumberISO

2016 52

2016 12 29

'Thursday'

DateFrom_Year_WeekNumberISO

2016 52

53

WeekNo_US

016 12 31

2016 12 25

DateFrom_Year_WeekNumberUS

2016 53

2016 12 29

'Thursday'

DateFrom_Year_WeekNumberUS

2016 53

Misc

5

DayOfWeekAsNumber

2016 1 1

'Friday'

DayOfWeek

2016 1 1

20000423 20010415

Easter

2000 2001

'2016-12-31 01:23:45'

FormatDateTime

20161231.012345

1 1 0

LeapYear

2000 2016 2100

60

OrdinalNumber

2016 2 29

Math

20161231

0

AddPeriod2DateTime

20161231

Add nothing

20181229

2

AddPeriod2DateTime

20161229

Add a year

20160229

0 2

AddPeriod2DateTime

20151229

Add a month

20161231

0 0 2

AddPeriod2DateTime

20161229

Add a day

20161229.032345

0 0 0 2

AddPeriod2DateTime

20161229.012345

Add an hour

20161230.022345

0 0 0 25

AddPeriod2DateTime

20161229.012345

Add a minute

20161229.014845

0 0 0 0 25

AddPeriod2DateTime

20161229.012345

Add a second

20161229.012348

0 0 0 0 0 3

AddPeriod2DateTime

20161229.012345

Add a millisecond

20000101

0

AddPeriod2DateTime

20000101

20030101

3

AddPeriod2DateTime

20000101

20030201

3 1

AddPeriod2DateTime

20000101

20030203

3 1 2

AddPeriod2DateTime

20000101

20030203.04

3 1 2 4

AddPeriod2DateTime

20000101

20030203.23

3 1 2 23

AddPeriod2DateTime

20000101

20030204

3 1 2 24

AddPeriod2DateTime

20000101

20030203.0405

3 1 2 4 5

AddPeriod2DateTime

20000101

20030203.0459

3 1 2 4 59

AddPeriod2DateTime

20000101

20030203.05

3 1 2 4 60

AddPeriod2DateTime

20000101

20030203.040507

3 1 2 4 5 7

AddPeriod2DateTime

20000101

20030203.040607

3 1 2 4 5 67

AddPeriod2DateTime

20000101

20141229

¯2

AddPeriod2DateTime

20161229

Substract a year

Requirements

DateAndTime needs at least version 14.1.

Project Page

For bug reports, future enhancements and a full version history see DateAndTime/ProjectPage

Version Information

Original author:

KaiJaeger

Responsible:

KaiJaeger

Email:

kai@aplteam.com

APLTree downloads

Using an APLTree member

  1. If you just want to consume (use) an APLTree member then you have several choices:
    • Note that accessing it via ftp allows you to download older versions as well while the dedicated download page offers just the most current version.

Contributing

If you want to contribute to an APLTree project see HowToContributeToTheAPLTreeProject for details.

Get the full project

If for some reason you need access to, say, the test cases then you need to get more then just the script (or application) itself.

HowToContributeToTheAPLTreeProject explains how to get a project onto your local machine. Just ignore any additional steps.

Create a new APLTree sub project

In order to create a new APLTree project you need some advice. Ask KaiJaeger for help: mailto:kai@aplteam.com


CategoryAplTree

DateAndTime (last edited 2016-09-22 08:00:39 by KaiJaeger)