Closed jwoertink closed 6 years ago
This might not be the place for this question, but I'm hoping you might know or at least where I should look for an answer...
If I store Time.now, the value I get back is going to be a string. Is there a way to get back that Time instance?
Time.now
redis = Redis.new redis.set("time", Time.now) value = redis.get("time") puts typeof(value) #=> (String | Time)
I can't just cast it with .as(Time) because I get a cast from String to Time failed error.
.as(Time)
cast from String to Time failed
After some thought, I came up with an idea for this. Storing as a string, and pulling back out as string will be fine.
This might not be the place for this question, but I'm hoping you might know or at least where I should look for an answer...
If I store
Time.now
, the value I get back is going to be a string. Is there a way to get back that Time instance?I can't just cast it with
.as(Time)
because I get acast from String to Time failed
error.