4 ms·
BankTransaction amount is a double? transactionDate is a LocalDate? Please nobody copy paste that class.
by time4tea 7y ago
BankTransaction amount is a double?
transactionDate is a LocalDate?
Please nobody copy paste that class.
- sdfin 7y agoWhat's the problem with using LocalDate to store a date (without time)?
- thu2111 7y agoThere's no timezone. LocalDate is appropriate for things like user interfaces, where you're modelling an intuitive/vague concept of date-ness only meaningful in some wider human context, or where the actual time at which that day starts just doesn't matter or is unknown. For instance it may be a good type to use for annotated historical events, where the day the event happened is the most accurate you can get. For a bank transaction where they're international by nature and usually need to be ordered temporally against each other, it's an inappropriate type. The time zone in which the date should be interpreted is important. But really for transactions you'd be better off using Instant, at least internally. Time matters too.