Coldfusion equiv php strtotime ()?

I am relatively new to CF / Flex3, and I was tasked with creating mock applications to learn about two languages.

I am creating an application where I need data for 1 week (strtotime equiv '-1 week').

So, the result is always worth 1 week.

What is the equivalent equivalent if it exists for coldfusion? If not, how would I accomplish this task? Curious what I was looking for, but I can not find anything else on this topic.

How I decided this (get data from "last Friday"):

<cfset lastweek = dateAdd("d", -(DayOfWeek(now()) + 1), now()) />


strtotime Understand
any textual description of the date and time in English in a Unix timestamp

+3
source share
2 answers

, ColdFusion ( ), . Google . , .

, 1 , - , dateadd():

<cfset variables.lastweek = dateAdd("w",-1,now()) />

<cfset variables.lastweek = dateAdd("d",-7,now()) />

, now() .

Update:

, CF java, Java, . , java , :

PHP strtotime() Java?

PHP strtotime() Java

+4
+1

Source: https://habr.com/ru/post/1718736/


All Articles