I am using fs (Node Module) to manage files. I am getting the file's created time (BirthTime). It is working absolutely fine when I run this app on my local machine. But when I try to implement it on EFS using NodeJs Lambda function then it gives 1970-01-01T00:00:00.000Z which is not the actual time of the file that I created.
var efsDirectory = "/mnt/data/";
var filePath = path.join(efsDirectory, file);
console.log("This file is going to be executed :", file);
var response = fs.statSync(filePath);
let fileBirthTime = response.birthtime;
console.log("File path is : ", filePath);
After joining the path my filepath looks like this filepath = /mnt/data/172.807056.json which is the actual path of the file.
In the Cloudwatch logs I am getting this :
On the local machine, it is working fine and giving the actual file birthtime. Can you tell me guys why I am getting this?