0

I am using RevenueCat with Firebase that has a field of expires_date with a type of string, not Timestamp, I am writing a rule to allow only if expires_date is less than now:

expires_date.toMillis() < request.time.toMillis()

However, expires_date is string.

Is there a way to convert string to Timestamp?

Here is an example: 2025-02-08T19:59:01Z.

Bilal Sammour
  • 421
  • 4
  • 9
  • 1
    You might want to edit the question to show the actual string you want to convert. If this conversion is possible at all, it's going to require code to break down that string into date parts and reassemble them in a new form. It's probably going to be easier for you not to do this in rules and instead write some application code to make sure there is a field available that's easy to use in security rules. – Doug Stevenson Feb 11 '23 at 15:23

0 Answers0