Get current date?

  • 1
  • Question
  • Updated 6 years ago
  • Answered
Is there a way to get the current date to use in a template or a page title? It isn't a field in any model that I have on my page.
Photo of Peter Bender

Peter Bender, Champion

  • 6,296 Points 5k badge 2x thumb

Posted 7 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 54,054 Points 50k badge 2x thumb
The easiest way to do it would be to add a Formula field of type Date called "Today__c", whose formula is "TODAY()", on the object whose Model you'd use for the PageTitle component, and then include that field in that Model. Then you could use it like any other field.

There's currently no merge field in the Skuid API that just gives you the current date, but it would be nice to have one!
Photo of Jacob Flatter

Jacob Flatter

  • 1,532 Points 1k badge 2x thumb
Is this still true?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
If you don't mind going to javascript you can use this syntax:  

$.datepicker.formatDate('dd/mm/yy', new Date())

The JQuery datepicker format utilitity provides lots of ways to format the date.   (  
Photo of John Nelson

John Nelson, Product Manager

  • 3,448 Points 3k badge 2x thumb
Could also do this as well (from here: 
skuid.time.getSFDateTime( new Date() );