ew_CurrentDate() minus plus day or hours

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mihaadzic
User
Posts: 53

ew_CurrentDate() minus plus day or hours

Post by mihaadzic »

Hi!

Is it possible to add or remove some hours or even days in the ew_CurrentDate() function and how?

Thanx!


kirondedshem
User
Posts: 642

Post by kirondedshem »

This is just basic php funcionality, its has nothing to do with phpmaker, so google php date operations and you should see alot of examples but it would be something like this.

  1. go to all pages->global->global code and create a function to do that,This is where you place functions you want to call from anywhere, retturnfor example 6 days before the current day.
    function GetCurrentDateLess7Days()
    {
    $today = ew_CurrentDate();
    $last_week = date('m/d/Y',(strtotime ( '-6 day' , strtotime ( $today) ) ));
    return $last_week;
    }

  2. Now just call GetCurrentDateLess7Days() in any php code to get precalculated date or time.

HInt:phpmaker is programming oriented so I advise you to learn some basics coz although it can most fo the heavy lifting , you will get many similar cases where you need to tweak something small and without php programming background you will get stack,SO take some time to learn some html php and javascript coz you will need them along the way.
Also read thier help file as it tells you want each section does


Post Reply