fork(241) download
  1. /* package whatever; // don't place package name! */
  2. import org.joda.time.DateTime;
  3. import org.joda.time.DateTimeZone;
  4. import org.joda.time.format.DateTimeFormat;
  5. import org.joda.time.format.DateTimeFormatter;
  6. import org.junit.Test;
  7. public class Test1 {
  8.  
  9. private static final DateTimeFormatter DATE_TIME_FORMAT =
  10. DateTimeFormat.forPattern("yyyyMMdd-HH:mm:ss");
  11.  
  12. @Test
  13. public void test1() {
  14.  
  15. DateTime date_offset_01 = DATE_TIME_FORMAT.withZone(DateTimeZone.forID("UTC")).parseDateTime("20140110-10:00:00");
  16. DateTime date_offset_02 = DATE_TIME_FORMAT.withZone(DateTimeZone.forID("UTC")).parseDateTime("20140510-10:00:00");
  17.  
  18. DateTime zoned_01 = date_offset_01.withZone(DateTimeZone.forID("Europe/Vienna"));
  19. DateTime zoned_02 = date_offset_02.withZone(DateTimeZone.forID("Europe/Vienna"));
  20.  
  21. System.out.println(date_offset_01.toString("yyyMMdd-HH:mm:ss") +" " + zoned_01.toString("yyyMMdd-HH:mm:ss"));
  22. System.out.println(date_offset_02.toString("yyyMMdd-HH:mm:ss") +" " + zoned_02.toString("yyyMMdd-HH:mm:ss"));
  23. }
  24. }
  25.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:7: error: class Test1 is public, should be declared in a file named Test1.java
public class Test1 {
       ^
Main.java:2: error: package org.joda.time does not exist
import org.joda.time.DateTime;
                    ^
Main.java:3: error: package org.joda.time does not exist
import org.joda.time.DateTimeZone;
                    ^
Main.java:4: error: package org.joda.time.format does not exist
import org.joda.time.format.DateTimeFormat;
                           ^
Main.java:5: error: package org.joda.time.format does not exist
import org.joda.time.format.DateTimeFormatter;
                           ^
Main.java:6: error: package org.junit does not exist
import org.junit.Test;
                ^
Main.java:9: error: cannot find symbol
    private static final DateTimeFormatter DATE_TIME_FORMAT =
                         ^
  symbol:   class DateTimeFormatter
  location: class Test1
Main.java:12: error: cannot find symbol
    @Test
     ^
  symbol:   class Test
  location: class Test1
Main.java:10: error: cannot find symbol
            DateTimeFormat.forPattern("yyyyMMdd-HH:mm:ss");
            ^
  symbol:   variable DateTimeFormat
  location: class Test1
Main.java:15: error: cannot find symbol
        DateTime date_offset_01 = DATE_TIME_FORMAT.withZone(DateTimeZone.forID("UTC")).parseDateTime("20140110-10:00:00");
        ^
  symbol:   class DateTime
  location: class Test1
Main.java:15: error: cannot find symbol
        DateTime date_offset_01 = DATE_TIME_FORMAT.withZone(DateTimeZone.forID("UTC")).parseDateTime("20140110-10:00:00");
                                                            ^
  symbol:   variable DateTimeZone
  location: class Test1
Main.java:16: error: cannot find symbol
        DateTime date_offset_02 = DATE_TIME_FORMAT.withZone(DateTimeZone.forID("UTC")).parseDateTime("20140510-10:00:00");
        ^
  symbol:   class DateTime
  location: class Test1
Main.java:16: error: cannot find symbol
        DateTime date_offset_02 = DATE_TIME_FORMAT.withZone(DateTimeZone.forID("UTC")).parseDateTime("20140510-10:00:00");
                                                            ^
  symbol:   variable DateTimeZone
  location: class Test1
Main.java:18: error: cannot find symbol
        DateTime zoned_01 = date_offset_01.withZone(DateTimeZone.forID("Europe/Vienna"));
        ^
  symbol:   class DateTime
  location: class Test1
Main.java:18: error: cannot find symbol
        DateTime zoned_01 = date_offset_01.withZone(DateTimeZone.forID("Europe/Vienna"));
                                                    ^
  symbol:   variable DateTimeZone
  location: class Test1
Main.java:19: error: cannot find symbol
        DateTime zoned_02 = date_offset_02.withZone(DateTimeZone.forID("Europe/Vienna"));
        ^
  symbol:   class DateTime
  location: class Test1
Main.java:19: error: cannot find symbol
        DateTime zoned_02 = date_offset_02.withZone(DateTimeZone.forID("Europe/Vienna"));
                                                    ^
  symbol:   variable DateTimeZone
  location: class Test1
17 errors
stdout
Standard output is empty