No worries, I fixed it for now like this… I pass to my function a object which has unit of sec or timestamp and check the value.
let expiresec: number = 0;
if(option && option.unit === 'sec')
if(option.value <= 2592000){
expiresec = option.value;
} else {
let currentTimeStamp:number = new Date().getTime() / 1000
let newTimeStamp: number = currentTimeStamp + (option.value)
expiresec = newTimeStamp
}
else if(option && option.unit === 'timestamp'){
expiresec = option.value;
}