Timestamp API Reference

 Handle String variables in SQL Timestamp format.

In the Alinous-Core programming language, the timestamp is a string with the SQL's Timestamp format. The format is below.

yyyy-MM-dd HH:mm:ss

 "yyyy" is year, "MM" is month starts with 01, dd is date, HH is hour of the day starts from 00 and end with 23. "mm" is minutes and "ss" is second.

These functions are wrapped by JavaConnector, and the are from "java.sql.Timestamp" class of the Java language.

add($timestamp, $amount, $field)

 Add value to the timestamp's specified field.The $amount can be minus value.
The $field is 'YEAR', 'MONTH', 'DATE', 'HOUR', 'MINUTE', 'SECOND' or 'MILLISECOND'

after($timestamp, $whenTimestamp)

 Return if $timestamp is after $whenTimestamp. Returned value is true or false.

before($timestamp, $whenTimestamp)

 Return if $timestamp is before $whenTimestamp. Returned value is true or false.

convertDayOfWeek($num, @dayOgWeeks)

 Convert the index, returned by Timestamp.getDayOfWeek(), into string value.

diffDate($timestamp, $timestamp2)

 Return difference between $timestamp and $timestamp2 in days.

diffSecond($timestamp, $timestamp2)

 Return difference between $timestamp and $timestamp2 in seconds.

format($timestamp, $format)

 Return formatted string.

formatLocale($timestamp, $format, $country, $language)

 Return formatted string with locale.

getDay($timestamp)

 Return the day of the timestamp.

getDayOfWeek($timestamp)

 Return the index of dayoftheweek of the timestamp. In order to convert the index into string value, use convertDayOfWeek().

getHour($timestamp)

 Return the hour of the timestamp.

getHourOfDay($timestamp)

 Return the hour of the day of the timestamp.

getMilliSecond($timestamp)

 Return the millisecond of the timestamp.

getMinute($timestamp)

 Return the munute of the timestamp.

getMonth($timestamp)

 Return the month of the timestamp.

getSecond($timestamp)

 Return the second of the timestamp.

getYear($timestamp)

 Return the year of the timestamp.

now()

 Return the current timestamp.

set($timestamp, $amount, $field)

 Set value to the timestamp's specified field.The $amount can be minus value.
The $field is 'YEAR', 'MONTH', 'DATE', 'HOUR', 'MINUTE', 'SECOND' or 'MILLISECOND'

validate($timestamp)

 Return the string is a valid timestamp format or not. Returned value is true or false.


Go to Top