also been removed. Any configuration which tries to use them will
result in an error.
+Dates and time attributes can be checked against date strings by
+casting them:
+
+```
+if (&Date-attribute < (date) 'Aug 1 2023 01:02:03 UTC') {
+ ...
+}
+```
+
+The current time can also be checked:
+
+```
+if (%time() < (date) 'Aug 1 2023 01:02:03 UTC') {
+ ...
+}
+```
+
== Deleted Functionality
Many "virtual" or "fake" attributes have been removed or renamed.
&Acct-Start-Time := %time(now)
----
+The current time can also be compared to a known date:
+
+.Example
+[source,unlang]
+----
+if (%time() < (date) 'Aug 1 2023 01:02:03 UTC') {
+ ...
+}
+----
+
+The format of the date strings should be the same format as the server
+prints out. The parse will try to accept other date formats (raw
+integer, etc.), but not all formats are guaranteed to work. There are
+hundreds of different date formats used across the world, and the
+server cannot support them all.
+
[NOTE]
====
This expansion should be used in preference to the xref:xlat/character.adoc[single letter expansions] `%l`. That expansion returns integer seconds, and is not suitable for millisecond or microsecond resolution.
test_fail
}
+#
+# Do date comparisons
+#
+if (&test_date != (date) 'Aug 8 2022 19:04:19 UTC') {
+ test_fail
+}
+
+if (&test_date < (date) 'Aug 8 2022 18:00:00 UTC') {
+ test_fail
+}
+
+if (&test_date > (date) 'Aug 9 2022 00:04:19 UTC') {
+ test_fail
+}
+
+
success