Welcome, Guest
Username: Password:

TOPIC: year calculation

year calculation 3 years 3 months ago #92127

  • ocean
  • ocean's Avatar
  • Offline
  • Premium Lime
  • Posts: 25
  • Karma: 0
Hi,

how can I use in the questions the actual year.
and how can I calculate the next year with it.

for example:
Are you also helping the next season {year} till {year+1}
Last Edit: 3 years 3 months ago by ocean.
The administrator has disabled public write access.

year calculation 3 years 3 months ago #92128

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1713
  • Thank you received: 426
  • Karma: 106
Hello,

The following javascript snippet can be use to display the current year:
<script type="text/javascript">
    var year=mydate.getFullYear();
    document.write(year);
</script>
... and this one to display next year:
<script type="text/javascript">
    var year=mydate.getFullYear();
    document.write(year+1);
</script>
Just copy each one where needed
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
Last Edit: 3 years 3 months ago by Ben_V.
The administrator has disabled public write access.

year calculation 3 years 3 months ago #92129

  • ocean
  • ocean's Avatar
  • Offline
  • Premium Lime
  • Posts: 25
  • Karma: 0
Can I put this in also in the title of a question?
The administrator has disabled public write access.

year calculation 3 years 3 months ago #92130

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1713
  • Thank you received: 426
  • Karma: 106
yes... try it!
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.
The following user(s) said Thank You: ocean

year calculation 3 years 3 months ago #92131

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1713
  • Thank you received: 426
  • Karma: 106
oups sorry I did, a little mistake :silly:
<script type="text/javascript">
var mydate=new Date,year=mydate.getFullYear();
document.write(year+1);
</script>
 
<script type="text/javascript">
var mydate=new Date,year=mydate.getFullYear();
document.write(year);
</script>
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.

year calculation 3 years 3 months ago #92133

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1713
  • Thank you received: 426
  • Karma: 106
and maybe it's more convenient to use the Expression Manager:

Year:
{date("Y")}

Year+1:
{(date("Y")+1)}
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.225 seconds