sivarajan_ece. It would be wrong to compare Nov2015 to Sep 2016 which would be 11 months. The return value is in the range of 1000 to 9999 or 0 for 'zero' date. each » « count . Hi, Can anyone mention how to write expression within a Textbox, in order to fetch "CurrentYear" part of the date. Word of wisdom: don't rely solely on timestamp calculations e.g. The Unix timestamp contains the number of seconds between the Unix Epoch (January 1 1970 00:00:00 GMT) and the time specified. Related methods: The Year property returns the year of the current instance in the Gregorian calendar. I need a where clause that will all the records from the previous year and up to todays date. If you have used functions in PHP before, it's a great way to get started. Top Rated; Most Recent; Please Sign up or sign in to vote. It takes two steps-. Since this is impractical for humans to read, PHP converts timestamp to a format that is readable and more understandable to humans. would generate last day from last month this year. v3. Same way we can extend this to get date values of last 7 days. now + 24 hours and so on, because you may need to take into account daylight If omitted, the current date and time will be used (as in the examples above). Likewise for Jan-Sep 2015. PHP date() function is used to get current date in web applications. The YEAR() function returns the year part for a given date (a number from 1000 to 9999). Peter, your page needs to be saved as a PHP i.e. So the visitor can easily make the choice of date month and year. There is an alternative approach to calculating days given the day, month and year of the dates to be compared. The computer stores date and time in UNIX Timestamp. A very common feature of forms is the dropdown