Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / web / public_php / api / time.php
blob34d8847fb6b1805f783532151336d2608aace970
1 <?php
3 require_once('common/config.php');
4 require_once('common/time.php');
5 require_once('common/xml_utils.php');
7 if (RYAPI_MODE == 'server') {
8 require_once('server/config.php');
9 require_once('server/time.php');
10 } else {
11 require_once('client/time.php');
14 $format = 'raw';
15 if (isset($_GET['format'])) $format = trim($_GET['format']);
17 // Compute
19 $tick = ryzom_time_tick();
20 switch($format) {
21 case 'raw':
22 echo $tick;
23 break;
24 case 'txt':
25 $rytime = ryzom_time_array($tick);
26 echo ryzom_time_txt($rytime);
27 break;
28 case 'xml':
29 $rytime = ryzom_time_array($tick);
30 ryzom_display_xml_header();
31 echo ryzom_time_xml($rytime)->asXML();
32 break;