File tree Expand file tree Collapse file tree
extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import java .text .SimpleDateFormat ;
55import java .util .Calendar ;
66import java .util .Date ;
7- import java .util .concurrent . TimeUnit ;
7+ import java .util .TimeZone ;
88
99import org .jsoup .helper .StringUtil ;
1010import org .schabi .newpipe .extractor .exceptions .ContentNotAvailableException ;
1313import com .grack .nanojson .JsonObject ;
1414
1515public class PeertubeParsingHelper {
16-
16+
1717 private PeertubeParsingHelper () {
1818 }
1919
2020 public static void validate (JsonObject json ) throws ContentNotAvailableException {
2121 String error = json .getString ("error" );
22- if (!StringUtil .isBlank (error )) {
22+ if (!StringUtil .isBlank (error )) {
2323 throw new ContentNotAvailableException (error );
2424 }
2525 }
26-
26+
2727 public static Calendar parseDateFrom (String textualUploadDate ) throws ParsingException {
2828 Date date ;
2929 try {
30- date = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.S'Z'" ).parse (textualUploadDate );
31- date = new Date (date .getTime () + TimeUnit .HOURS .toMillis (1 ));
30+ SimpleDateFormat sdf = new SimpleDateFormat ("yyyy-MM-dd'T'HH:mm:ss.S'Z'" );
31+ sdf .setTimeZone (TimeZone .getTimeZone ("GMT" ));
32+ date = sdf .parse (textualUploadDate );
3233 } catch (ParseException e ) {
3334 throw new ParsingException ("Could not parse date: \" " + textualUploadDate + "\" " , e );
3435 }
You can’t perform that action at this time.
0 commit comments