.net Standard redis dates

I recently upgraded to 5.8 as part of a large refactor including migrating as much code as possible to .net standard (including pulling most registration code into an IPlugin). Since doing this, we are getting very sporadic instances of DateTimes being stored in Redis in the following (UK) format: “dd/MM/yyyy HH:mm:ss”. This is running on Azure WebApps so has no context of “being in the UK”.

Can you think of any Redis serialisation path that would lead to this? I have the following but no-idea really what this does.

RequestContext.UseThreadStatic = false;

If it was american format, I would be less flummoxed as that’s the default date format in DateTimeSerializer, but it’s UK format.

We don’t set the thread’s culture anywhere

public void CacheEntity<T>(T entity) where T : BaseEntity
        {
            if (entity == null) return;
            if (!entity.GetType().HasAttribute<CacheMeAttribute>()) return;
            using (var client = ClientManager.GetClient())
            {
                var key = EntityKey(entity);
                client.Add(key, entity);
            }
        }

Clutching at straws, so any help appreciated.

This doesn’t do anything as UseThreadStatic is false by default:

RequestContext.UseThreadStatic = false;

In unit/integration tests you may want to change the behavior to maintain a Request Context in a thread, but it doesn’t change anything so can be removed.

I don’t know what’s causing it, but I’d be looking at code running in background threads as that’s typically where Culture Info is lost. BTW the “dd/MM/yyyy” format isn’t just UK, that’s basically the format for most of the world AFAIK.

Either way I’d recommend tackling it like any issue and focus on isolating the issue in order to create an isolated repro.