Year Variable

This forum is for all Flare issues not related to any of the other categories.
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Year Variable

Post by Nita Beck »

oceanclub wrote:Just bumping this 7 years later! It really would be useful if "year" was added as a system variable.
I think you can accomplish this with a custom date-time variable (introduced in Flare 10, I think): http://webhelp.madcapsoftware.com/flare ... iables.htm
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
wclass
Propellus Maximus
Posts: 1238
Joined: Mon Feb 27, 2006 5:56 am
Location: Melbourne, Australia

Re: Year Variable

Post by wclass »

You can now create date/time variables that you can format yourself. Look up Custom Date/Time variables.
In the variable set editor, there is an extra Add button specially for Date/Time.
You can create one with the format style of "yyyy" to get just the year. "MMM-yyyy" will map to the month and year, and so on.
Margaret Hassall - Melbourne
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Re: Year Variable

Post by oceanclub »

Ah, thanks. We're still on version 9 so I didn't see this functionality.

regards,

P.
SusanL
Propeller Head
Posts: 77
Joined: Thu Nov 13, 2008 6:50 am
Location: Atlanta metro

Re: Year Variable

Post by SusanL »

I see you found the answer.
nielsf
Propeller Head
Posts: 86
Joined: Mon Feb 02, 2015 5:44 am
Location: Copenhagen, Denmark

Re: Year Variable

Post by nielsf »

Sure you can. Open the variable set, and click button no. 2 in the local toolbar. This is called "Add Date/Time variable".
Give it a name such as CurrentYear, and enter the following in the Definition field:
yyyy
Flare shows a preview of the result at you type.
You can choose if you want the year updated at Build time, on file creation, file save, project save, or manually.
If you want to add certain strings such as "/" in the date string, enclose them in single dabs: '/' (otherwise the separator will follow your chosen locale).
I should think that would cover it..!
EDIT - Dang-didn't see the last posts... classic "page 2 problem..." sorry for duplicate.
-Niels
-----
Flaring in Copenhagen, Denmark
Toko
Propeller Head
Posts: 25
Joined: Thu Jul 05, 2018 3:24 am

Re: Year Variable

Post by Toko »

I have a variable called CopyRight date and its value is YYYY

it works...
devjoe
Sr. Propeller Head
Posts: 342
Joined: Thu Jan 23, 2014 1:43 pm

Re: Year Variable

Post by devjoe »

Flare supports formatted date variables which let you specify which parts of the date you want displayed, which you could use to specify only the year is displayed.
https://help.madcapsoftware.com/flare20 ... iables.htm
These variables can also be configured to show the date the file was saved, the date the project was built, etc.
The one thing they cannot do is what the first poster wanted, to show the current time when the topic was viewed. You'd need some javascript that grabs the local system time to make that happen.
Post Reply