In a simple calendar program, hourly computation is used to solve a simple personal calendar program. one function is to enter the calendar or notebook. when writing data tables, the hourly computation code is as follows, what does the red part mean? $ Evt_pm (isset ($ _ POST [evt_pm]) & amp; $ _ POST [evt_pm] yes ); $ evt_hour (isset ($ _ POST [evt an hourly computation solution in a simple calendar program
In a simple personal calendar program, one function is to enter a calendar or notebook. when writing data tables, the hourly calculation code is as follows. what does the red code mean?
$ Evt_pm = (isset ($ _ POST ['evt _ pm ']) & $ _ POST ['evt _ pm'] = 'yes ');
$ Evt_hour = (isset ($ _ POST ['evt _ hour '])? (Int) $ _ POST ['evt _ hour']: 0;
If ($ evt_pm)
{
$ Evt_hour + = 12;
}
If ($ evt_hour = 24)
{
$ Evt_hour = 12;
}
Else if ($ evt_hour = 12)
{
$ Evt_hour = 0;
}
// Write data to the database
$ Query = sprintf ('Insert INTO % sCALENDAR (EVENT_NAME, EVENT_TSTAMP ,'.
'Your Y) VALUES ("% s", "% 04d-% 02d-% 02d % 02d: % 02d: 00", % d )',
DB_TBL_PREFIX,
Mysql_real_escape_string ($ evt_name, $ GLOBALS ['DB']),
$ Year, $ month, $ day,
$ Evt_hour, $ evt_min,
$ Evt_policy );
The form for submitting a calendar is as follows:
// Hour selection
12 For ($ I = 1; $ I <12; $ I ++){Printf ('% 02d', $ I, $ I );}?>
// Select in minutes
For ($ I = 0; $ I <59; $ I + = 15){Printf ('% 02d', $ I, $ I );}?>
// Select the last afternoon
AM PM
------ Solution --------------------
I only read the red part. I guess it should be 24 hours to 12: 12 hours to 0, that is, 24 hours to 12 hours? Haha
------ Solution --------------------
Storage time format.
------ Solution --------------------
Understand the time format.