2

I write mobile application with Corona SDK that interacts with Facebook.

On user's Facebook login I receive "expiration of access token" from Facebook in ms. I want to send it to Parse.com (SAAS) in the yyyy-MM-dd'T'HH:mm:ss.SSS'Z' date format.

How can I do it?

TatianaCooper
  • 155
  • 2
  • 13
  • Related to http://stackoverflow.com/questions/11378822/getting-previous-days-date-in-lua. – lhf Jul 08 '12 at 11:36

2 Answers2

4
date = os.date("!%Y-%m-%dT%H:%m:%S.000Z")

You'll have to leave the milliseconds as 0, because you can't get those from os.date. Also the ! at the start is required to get UTC time (as opposed to local time), which is what the Z at the end signifies.

More info.

Mud
  • 28,277
  • 11
  • 59
  • 92
0

The LuaDate library apt for Date Manipulationss http://luaforge.net/projects/date/

It is very easy to use, and it is documented well! You can download it from here http://files.luaforge.net/releases/date/date

There may be other easier ways as well.

SatheeshJM
  • 3,575
  • 8
  • 37
  • 60