Neo
Neo

Reputation: 817

How to get the internalDate in Gmail API?

I am using Gmail API and am getting the variables in Javascript. I can access the Date but not the internalDate.

  var inDate = getHeader(message.payload.headers, 'internalDate');
  console.log(inDate);

it does not log anything; the string is empty. But when I log the Date, it logs the date like this: "Sun, 15 Jul 2018 21:41:56 +0000"

  var Date = getHeader(message.payload.headers, 'Date');
  console.log(Date);

Now, how do I get the internalDate ?

Upvotes: 0

Views: 1129

Answers (1)

Arun D
Arun D

Reputation: 2387

Instead of accessing internalDate from message.payload.headers, try to access the internalDate from message.internalDate

Eg:

var internalDateVal = message.internalDate;

Upvotes: 2

Related Questions