File tree 2 files changed +5
-5
lines changed
main/java/com/google/firebase/messaging
test/java/com/google/firebase/messaging
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 28
28
import java .util .Date ;
29
29
import java .util .List ;
30
30
import java .util .Map ;
31
+ import java .util .TimeZone ;
31
32
import java .util .concurrent .TimeUnit ;
32
33
33
34
/**
@@ -456,8 +457,9 @@ public Builder setSticky(boolean sticky) {
456
457
* @return This builder.
457
458
*/
458
459
public Builder setEventTimeInMillis (long eventTimeInMillis ) {
459
- this .eventTime = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'" )
460
- .format (new Date (eventTimeInMillis ));
460
+ SimpleDateFormat dateFormat = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.SSS000000'Z'" );
461
+ dateFormat .setTimeZone (TimeZone .getTimeZone ("UTC" ));
462
+ this .eventTime = dateFormat .format (new Date (eventTimeInMillis ));
461
463
return this ;
462
464
}
463
465
Original file line number Diff line number Diff line change @@ -859,15 +859,13 @@ public void testExtendedAndroidNotificationParameters() throws IOException {
859
859
.put ("title" , "title" )
860
860
.put ("body" , "body" )
861
861
.build ();
862
- String eventTime = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'" , Locale .US )
863
- .format (new Date (1546304523123L ));
864
862
Map <String , Object > androidConfig = ImmutableMap .<String , Object >builder ()
865
863
.put ("notification" , ImmutableMap .<String , Object >builder ()
866
864
.put ("title" , "android-title" )
867
865
.put ("body" , "android-body" )
868
866
.put ("ticker" , "ticker" )
869
867
.put ("sticky" , true )
870
- .put ("event_time" , eventTime )
868
+ .put ("event_time" , "2019-01-01T01:02:03.123000000Z" )
871
869
.put ("local_only" , true )
872
870
.put ("notification_priority" , "PRIORITY_HIGH" )
873
871
.put ("vibrate_timings" , ImmutableList .of ("1s" , "1.001000000s" ))
You can’t perform that action at this time.
0 commit comments