メインコンテンツまでスキップ

Date Calculated Fields

Date formulas can be used to output different date and time information in your widget.

注記

Your calculated field will show the information you include in the formula, overwriting of the formatting you have set for Date and Time.

Date functions:

Function NameSyntax and Sample
dateSyntax: date({year},{month},{day},{hour},{minute},{second})
Sample: date(1971,11,08,12,59,08)
datevalueSyntax: datevalue({date},{format},{locale})
Sample: datevalue("23/05/2015","dd/mm/yyyy","en")
daySyntax: day({date})
Sample: day(date(1971,11,08,01,22,44))
formatdateSyntax: formatdate({date},{format},{locale})
Sample: formatdate(date(1971,11,08,01,22,44),"dd/mm/yyyy","en")
fquarterSyntax: fquarter({date},{number})
Sample: fquarter(date(2017,12,1,12,33,48),4)
fyearSyntax: fyear({date},{number})
Sample: fyear(date(2017,12,1,12,33,48),2)
hourSyntax: hour({date})
Sample: hour(date(2017,12,1,12,33,48))
millisecondSyntax: millisecond({time})
Sample: millisecond(time(11,29,48,799))
minuteSyntax: minute({date})
Sample: minute(date(2017,12,1,12,33,48))
monthSyntax: month({date})
Sample: month(date(2017,12,1,12,33,48))
monthnameSyntax: monthname({date},{locale})
Sample: monthname(date(2017,12,1,12,33,48),"en")
monthshortnameSyntax: monthshortname({date},{locale})
Sample: monthshortname(date(2017,12,1,12,33,48),"en")
nowSyntax: now()
Sample: now()
quarterSyntax: quarter({date})
Sample: quarter(date(2017,12,1,12,33,48))
secondSyntax: second({date})
Sample: second(date(2017,12,1,12,33,48))
timeSyntax: time({hour},{minute},{second},{millisecond})
Sample: time(11,08,08,11)
todaySyntax: today()
Sample: today()
weekdaySyntax: weekday({date})
Sample: weekday(date(2017,12,1,12,33,48))
weeknumSyntax: weeknum({date})
Sample: weeknum(date(2017,12,1,12,33,48))
yearSyntax: year({date})
Sample: year(date(2017,12,1,12,33,48))
semesterSyntax: semester({datetime})
Sample: semester(datetime(1))
fsemesterSyntax: fsemester({date}, {number})
Sample: fsemester(date(2015,11,1,11,33,48),1)
applytimezoneSyntax: applytimezone({date}, {timezone})
Sample: applytimezone(date(2015,12,1,10,33,38), ([Timezone]/24))
currenttimezoneSyntax: currenttimezone()
Sample: currenttimezone()
datetimefromunixtsSyntax: datetimefromunixts ({miliseconds})
Sample: datetimefromunixts(0.001)

Date

When you use date, Reveal will return a date set to the values you include in your formula.

Syntax

By default, you will see the following structure when you select date:

date({year},{month},{day},{hour},{minute},{second})

All values, including month, need to be expressed with numerical values.

Samples

A formula with the following structure will return "08-Nov-1971 12:59":

Function NameYearMonthDayHourMinuteSecond
date (…​)19711108125908

A formula with the following structure, however, will return "09-Nov-1971 03:59", because the value in "hour" exceeds 24 hours. Make sure you respect the order of the elements in the formula:

Function NameYearMonthDayHourMinuteSecond
date (…​)19711108275908

Time

When you use time, Reveal will return a time set to the values you include in your formula.

Syntax

By default, you will see the following structure when you select time:

time({hour},{minute},{second},{millisecond})

Samples

A formula with the following structure will return "11:08:08":

Function NameHourMinuteSecondMillisecond
time (…​)11080811

The millisecond parameter will not be included in your calculated field. However, you can include time within a different formula (millisecond) to display only that value.