Forum Discussion

qinglau's avatar
qinglau
Mentor
11 years ago

Control date format output

Hi All,    I would like to display the last login time of users in a date format :    dd-mm-yyyy, like 05-07-2013    I manage to use the REST API call get output : " Dec 12, 2013" <#ass...
  • VarunGrazitti's avatar
    VarunGrazitti
    11 years ago

    qinglau  That is because you are using a hard coded user ID '17' in the latestLogin and in lastVisit, you are using ${user.id} which is the current user.

     

    use this: 

    <#assign latestLogin = restadmin("/users/id/${user.id}/last_visit_time").value?datetime("yyyy-MM-dd'T'hh:mm:ss")?string("dd-MM-yyyy") />
    ${latestLogin}