Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Unable to Appery style datetime stamp last logged in

Is there is a way to get a timedate stamp thats identical to how a createdAt format in javascript in Appery. I need to stamp the last time they logged in, and compare it with the time NOW. But, in the same format, as a string, like Appery does in the database ?

I have searched the docs, but i cant see how ?

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Unable to Appery style datetime stamp last logged in

As an example, the below image, how did you populate the colume Time, did you use a code from the Appery Library ?

Image

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Unable to Appery style datetime stamp last logged in

Not sure that link really answered my question at all!

I will assume you have no function within the Appery library for it, so I created my own:

precode
function setdateFormat() {
var d = new Date();
var date = d.getDate();
var month = d.getMonth() + 1;
var year = d.getFullYear();
var hours = d.getHours();
var mins = d.getMinutes();

Code: Select all

 if (month < 10) { 
     month = '0' + month; 
 } 

 var datestring = year + "-" + month + "-" + date + " " + hours + ":" + mins + ":00&#46;000&quot 
 console&#46;log(datestring); 
 return datestring; 

}

/code/pre

This returns the correct format!.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Unable to Appery style datetime stamp last logged in

Thanks for sharing this, Bad Addy!

Return to “Issues”