Android Call log date convertion -
i have call log backup android mobile phone, , i'm trying know date & time of calls.
the log says:
<htccallog> new=1 numbertype=3 duration=28 number=person's phone number type=1 _id=1853 numberlabel=null name=person's name date=1333119990954
here's problem. when try converto date time (i'm using .net's cssharp), got following date 02/01/0001 01:01:51, of course not valid date of call.
trying convert today's date , time long number utc format, got 130134760479804654 larger number in log file.
could points me i'm doing wrong? following code.
long datelong = long.parse("1333119793100"); datetime date = new datetime(datelong, datetimekind.utc); console.writeline(date.tostring("dd/mm/yyyy hh:mm:ss")); datetime today = datetime.now; console.writeline("\n\n{0}\n{1}", today.tofiletimeutc(), datelong); console.readkey();
thanks much
sorry, don't know of unix word. googleing little, found 'epoch' time, found out convertion function:
public datetime fromunixtime(long unixtime) { var epoch = new datetime(1970, 1, 1, 0, 0, 0, datetimekind.utc); return epoch.addseconds(unixtime); }
thanks anyway.
Comments
Post a Comment