Skip to content

The UTC time represented when the offset is applied must be between year 0 and 10,000. Parameter name: offset #180

@nicoxiang

Description

@nicoxiang

Description

If your computer timezone is behind UTC, InMemoryCaching Set method will throw exception when we do not pass expiresIn parameter. ( I didn't use easycaching provider, i just copy some code in InMemoryCaching class, and use Set method directly...)

Steps to Reproduce

  1. adjust computer DateTime Time zone to UTC-08:00 (USA)
  2. call InMemoryCaching Set without expiresIn parameter.

Related code

var expiresAt = expiresIn.HasValue ? SystemClock.UtcNow.SafeAdd(expiresIn.Value) : DateTime.MaxValue;
return SetInternal(new CacheEntry(key, value, expiresAt));

refer to * https://stackoverflow.com/questions/13799214/the-utc-time-represented-when-the-offset-is-applied-must-be-between-year-0-and-1

new DateTimeOffset(DateTime.MaxValue)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions