Code Monkey home page Code Monkey logo

date-dateswithjodatime's Introduction

Handling some dates with library Joda-time.

How to compile and execute :
mvn package
I executed it from within eclipse directly.

I) Generalities
a)DateTime
A DateTime represents an exact point on the time-line, but limited to the precision of milliseconds. It calculates its fields with respect to a time zone.


b)DateTimeZone
A time zone.


Date string representations are based on ISO 8601 : https://en.wikipedia.org/wiki/ISO_8601

II)The code
showYear1970() shows how to represent Unix epoch.
showYearMinus5() shows how to represent a date before current era.
showYearSumerCivilization() shows how to represent early Sumer civilization date (-3400 BC).
showYearTyrannosaurus() shows how to... well, you know.
showAddingHourChangesDay() - showAddingDayChangesMonth() - showAddingDayChangesYear() - showAddingMonthChangesYear() shows how to add days/month to a Date through a joda DateTime.
showLeapAndNonLeapYear() tells whether a year is leap or not.
showDifferencesBetweenDifferentTimezones() shows that same "day/month/year" are different depending on the timezone.
showAllTimezonesAvailable() shows the timezones available.
showSomeDatesThroughPatterns() shows how to print dates with different formats, ex : "dd/MM/yyyy", "yyyy.MM.dd HH:mm:ss", "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"...
showParsingOfSomeStringsThroughPatterns() parses strings into dates through different formats.
showSomeDST() shows DST of London, New York and Berlin in march 2020.
showHourDifferenceBetweenLondonAndNewYorkVariesDueToDST() shows how time difference varies between New York and London due to DST not being applied at the same moment.
showSomeJodaDateTimeAndTimezoneClassesBehaviourDependingOnSystemTimezone() shows that a joda DateTime instance behaviour depends of the execution environment (the operating system/jvm configuration) by default.
showSomeJodaDateTimeAndTimezoneClassesBehaviourNotDependingOnSystemTimezone() shows how to have a joda DateTime behaving regardless of the system configuration.
showJodaDateTimeDoesnotHandleLeapSecond() shows joda DateTime don't handle leap seconds.
showHowToAddressAnHourThatHappensTwiceDuringTheSameDayWhenTheClockGoesBackward() shows how a developer can set a joda DateTime to both times referred by the same hour if that hour happens twice in the same day (DST clock backward). It is done through elapsed milliseconds.

date-dateswithjodatime's People

Contributors

thomascolomba avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.