Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var last_time = null;
- function get_note_ID() {
- // get current time
- now = moment().startOf('minute');
- if (last_time != null && now.isSameOrBefore(last_time))
- {
- // add one minute to moment
- now = last_time.add(1, "m");
- }
- last_time = now;
- return now.format("YYYYMMDDHHmm");
- }
- module.exports = get_note_ID;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement