Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format for date and time #2

Open
hmdadou opened this issue Apr 10, 2015 · 5 comments
Open

format for date and time #2

hmdadou opened this issue Apr 10, 2015 · 5 comments

Comments

@hmdadou
Copy link

hmdadou commented Apr 10, 2015

I would like to test this plugin could you tell me what is the format of alarmDate please.,

@jbaylina
Copy link
Contributor

It is a long. (Seconds since 1970-1-1.

See AlarmManager.set
El dia 10/04/2015 11.59, "Mohamed" [email protected] va escriure:

I would like to test this plugin could you tell me what is the format of
alarmDate please.,


Reply to this email directly or view it on GitHub
#2.

@hmdadou
Copy link
Author

hmdadou commented Apr 11, 2015

Thanks for your reply but unfortunately I couldn't understand what you
meant by
It is a long. (Seconds since 1970-1-1.

if I wanted to set the time and date for the alarm to start on this date
what would be the format.
example* 11/04/2015 10:30am*

much appreciated thanks

HM Dadou

On 10 April 2015 at 16:33, Jordi Baylina [email protected] wrote:

It is a long. (Seconds since 1970-1-1.

See AlarmManager.set
El dia 10/04/2015 11.59, "Mohamed" [email protected] va escriure:

I would like to test this plugin could you tell me what is the format of
alarmDate please.,


Reply to this email directly or view it on GitHub
#2.


Reply to this email directly or view it on GitHub
#2 (comment).

Best regards
HM Dadou

@manvick
Copy link

manvick commented May 19, 2015

Datetime format is converted to seconds after 1970-1-1
Use any Date/Epoch Converter to convert your date time to the specified format.

But i still cant get this working. :(

@ehsand
Copy link

ehsand commented Jul 5, 2015

you can simply change the time format in AlarmPlugin.java
ex:
change
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
Date aDate = sdf.parse(args.getString(0).replace("Z", "+0000"));
to
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date aDate = sdf.parse(args.getString(0));

@rashnk
Copy link

rashnk commented Apr 8, 2016

@ehsand , if i change the code as u mentioned above
navigator.plugins.alarm.set("2016-04-08 18:00",
function(){
// SUCCESS
},
function(){
// ERROR
})

is this correct ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants