GMTからseconds取得
Long gettime = Datetime.now().getTime();
System.debug('gettime:'+gettime);
gettime = gettime/1000;
System.debug('gettime:'+gettime);
結果
17:39:16:003 USER_DEBUG [8]|DEBUG|gettime:1654591156228
17:39:16:003 USER_DEBUG [11]|DEBUG|gettime:1654591156
ここで、1654591156:seconds