All Projects → exceptionless → Exceptionless.datetimeextensions

exceptionless / Exceptionless.datetimeextensions

Licence: apache-2.0
DateTimeRange, Business Day and various DateTime, DateTimeOffset, TimeSpan extension methods

Projects that are alternatives of or similar to Exceptionless.datetimeextensions

Period
PHP's time range API
Stars: ✭ 616 (+333.8%)
Mutual labels:  time, datetime, range
When
A natural language date/time parser with pluggable rules
Stars: ✭ 1,113 (+683.8%)
Mutual labels:  time, datetime
Laydate
layDate(日期与时间组件) 是 layui 独立维护的三大组件之一
Stars: ✭ 1,066 (+650.7%)
Mutual labels:  time, datetime
Delorean
Delorean: Time Travel Made Easy
Stars: ✭ 1,793 (+1162.68%)
Mutual labels:  time, datetime
Tail.datetime
A lightweight, translat- and configurable Open Source DateTime Picker, written in pure vanilla JavaScript!
Stars: ✭ 139 (-2.11%)
Mutual labels:  time, datetime
Tinydate
A tiny (349B) reusable date formatter. Extremely fast!
Stars: ✭ 990 (+597.18%)
Mutual labels:  time, datetime
Carbon
A simple PHP API extension for DateTime
Stars: ✭ 75 (-47.18%)
Mutual labels:  time, datetime
Singledateandtimepicker
You can now select a date and a time with only one widget !
Stars: ✭ 921 (+548.59%)
Mutual labels:  time, range
Luatz
Time, Date and Timezone library for lua
Stars: ✭ 92 (-35.21%)
Mutual labels:  time, datetime
Dateparse
GoLang Parse many date strings without knowing format in advance.
Stars: ✭ 1,365 (+861.27%)
Mutual labels:  time, datetime
Time Stamp
Get a formatted timestamp. Used in gulp, assemble, generate, and many others.
Stars: ✭ 104 (-26.76%)
Mutual labels:  time, datetime
Angular Datetime Range
📅 Angular directive for datetime range input
Stars: ✭ 27 (-80.99%)
Mutual labels:  datetime, range
Dayjs
⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
Stars: ✭ 37,373 (+26219.01%)
Mutual labels:  time, datetime
Zulu
A drop-in replacement for native Python datetimes that embraces UTC.
Stars: ✭ 52 (-63.38%)
Mutual labels:  time, datetime
Vue Datetime
Mobile friendly datetime picker for Vue. Supports date and datetime modes, i18n and more.
Stars: ✭ 928 (+553.52%)
Mutual labels:  time, datetime
Iso8601
Ruby parser to work with ISO8601 dateTimes and durations — http://en.wikipedia.org/wiki/ISO_8601
Stars: ✭ 70 (-50.7%)
Mutual labels:  time, datetime
Human time
Ruby time and date comparisons for humans
Stars: ✭ 113 (-20.42%)
Mutual labels:  time, datetime
Vue Ctk Date Time Picker
VueJS component to select dates & time, including a range mode
Stars: ✭ 707 (+397.89%)
Mutual labels:  time, range
Graphql Java Datetime
GraphQL ISO Date is a set of RFC 3339 compliant date/time scalar types to be used with graphql-java.
Stars: ✭ 89 (-37.32%)
Mutual labels:  time, datetime
Calendar
📅 PHP Date & Time library that solves common problems in object oriented, immutable way.
Stars: ✭ 113 (-20.42%)
Mutual labels:  time, datetime

Exceptionless.DateTimeExtensions

Build status NuGet Version Slack Status Donate

DateTimeRange, Business Day and various DateTime, DateTimeOffset, TimeSpan extension methods.

Getting Started (Development)

This package can be installed via the NuGet package manager. If you need help, please contact us via in-app support or open an issue. We’re always here to help if you have any questions!

  1. You will need to have Visual Studio Code installed.
  2. Open the root folder.

Using DateTimeExtensions

Below is a small sampling of the things you can accomplish with DateTimeExtensions, so check it out!

Business Day

Quickly calculate if a datetime is within your hours of business. Check out our unit tests for more usage samples.

var date = DateTime.Now.StartOfDay().AddHours(8);

var day = new BusinessDay(date.Date.DayOfWeek,
    date.Subtract(TimeSpan.FromHours(1)).TimeOfDay,
    date.AddHours(1).TimeOfDay);

bool isDay = day.IsBusinessDay(date);

DateTime Ranges

Quickly work with date ranges. . Check out our unit tests for more usage samples.

var range = DateTimeRange.Parse("yesterday", DateTime.Now);
if (range.Contains(DateTime.Now.Subtract(TimeSpan.FromHours(6)))) {
  //...
}

TimeUnit

Quickly work with time units. . Check out our unit tests for more usage samples.

TimeSpan oneNanosecond = TimeUnit.Parse("1nanos");
TimeSpan oneMicrosecond = TimeUnit.Parse("1micros");
TimeSpan oneMillisecond = TimeUnit.Parse("1ms");
TimeSpan oneSecond = TimeUnit.Parse("1s");
TimeSpan oneMinute = TimeUnit.Parse("1m");
TimeSpan oneHour = TimeUnit.Parse("1h");
TimeSpan oneDay = TimeUnit.Parse("1d");

DateTime Extension methods

Helper methods that makes working with DateTimes easier. Check out the source for all of the extension methods you can use.

using Exceptionless.DateTimeExtensions;

DateTime.Now.ToApproximateAgeString(); // "Just now"
var time = DateTime.Now.StartOfMinute();
var lastWeek = DateTime.Now.LastWeek();
var nextWeek = DateTime.Now.NextWeek();

DateTimeOffset Extension methods

Helper methods that makes working with DateTimeOffsets easier. Check out the source for all of the extension methods you can use.

using Exceptionless.DateTimeExtensions;

DateTimeOffset.Now.ToApproximateAgeString(); // "Just now"
var startOfMonth = DateTimeOffset.Now.ToStartOfMonth();
var endOfMonth = DateTimeOffset.Now.ToEndOfMonth();

Timespan Extension methods

Helper methods that makes working with TimeSpans easier. Check out the source for all of the extension methods you can use.

using Exceptionless.DateTimeExtensions;

var years = TimeSpan.FromHours(6).GetYears();
var totalYears = TimeSpan.FromHours(6).GetTotalYears();

Thanks to all the people who have contributed

contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].