How to use the unix function from moment

Find comprehensive JavaScript moment.unix code examples handpicked from public code repositorys.

1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
if (!group) return;

let announcement = group.announcement;
if (!announcement) return;

if (now) now = moment.unix(now);
else now = moment();

let emb = null, message = await this.getAnnouncementMessage(group.id, announcement.id);
if (message && message.embeds[0]) {
fork icon2
star icon3
watch icon2

+ 5 other calls in file

28
29
30
31
32
33
34
35
36
37
}

if (timeDiff > 0) {
	const m = await message.channel.send(`**Time until ${args.slice(1).join(' ')}:** ${humanizeDuration(timeDiff, {round: true})}`);
	client.CountdownModel.create({
		unixTime: moment.unix(args[0]),
		messageID: m.id,
		channelID: m.channel.id,
		description: args.slice(1).join(' ')
	});
fork icon1
star icon2
watch icon5

+ 3 other calls in file

64
65
66
67
68
69
70
71
72
73
74


exports.checkRenewal = async function () {
    const certs = await this.getCerts();
    for (let key of Object.keys(certs)) {
        const cert = certs[key];
        const oneMonth = moment.unix(cert.created).add(1, 'month');
        if (!moment().isAfter(oneMonth)) {
            app.log('Renewing:', cert.domain, cert.email);
        }
    }
fork icon0
star icon0
watch icon2

+ 7 other calls in file