FIND YOUR NEXT FEW LINES

Results for “time”

Small, practical examples. Search by task or narrow things down below.

236 snippets foundClear filters
JavaDates & time zones

Find the last day of a month

Java: Use YearMonth so leap years and month lengths are handled by the calendar library.

Java✓ Tested
JavaDates & time zones

Find the next chosen weekday

Java: TemporalAdjusters.next excludes the starting day even if it already has that weekday.

Java✓ Tested
PythonDates & time zones

Find the number of days in a month

Python: Use calendar.monthrange to account for leap years.

Python✓ Tested
GoDates & times

Find the weekday for a date

Find the weekday for a date using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaDates & time zones

Generate a half-open range of dates

Java: datesUntil includes the starting date and excludes the end date.

Java✓ Tested
HTMLGetting Started

Give a date a machine-readable value

HTML: Learn how to give a date a machine-readable value in a complete browser example.

HTML✓ Tested
Arduino / CSerial protocols

Handle incomplete serial input

Arduino / C: The returned byte count distinguishes a complete payload from a timed-out partial one.

Arduino / C✓ Tested
HTMLLinks & accessibility

Mark up a machine-readable date

Pair a readable date with an ISO datetime attribute in HTML.

HTML✓ Tested
JavaDates & time zones

Measure a duration between instants

Java: Use Duration for elapsed timeline time and retrieve total seconds.

Java✓ Tested
GoDates & times

Measure a duration between instants

Measure a duration between instants using a complete Go program with explicit sample inputs.

Go✓ Tested
GoDates & times

Parse a date with a Go layout

Parse a date with a Go layout using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaDates & time zones

Parse a date with an explicit input pattern

Java: Use DateTimeFormatter for a non-ISO date representation.

Java✓ Tested