Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html><head>
- <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
- <meta http-equiv='Content-Language' content='EN'>
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
- <title>DMS</title>
- <style>
- body {
- font-size: 1.3em;
- font-size-adjust: from-font;
- font-variant: small-caps;
- color: orange;
- background: radial-gradient(rgb(0, 0, 0) 25%, rgb(0, 0, 35));
- }
- button {
- margin: 1px;
- margin-bottom: 16px;
- padding: 3px 5px;
- font-size: 12px;
- border-radius: 3px;
- }
- </style></head><body>
- <center><br><br><div id='dateTime'></div>
- <script src='dtscript.js'></script>
- <?
- date_default_timezone_set('America/New_York');
- $Today = getdate(); $CurrentTS = mktime($Today['hours'],$Today['minutes'],0,$Today['mon'],$Today['mday'],$Today['year']);
- $AddlTime = '+25 hours 1 minute'; $DMSTime = date("U", strtotime($AddlTime, $CurrentTS));
- $FinalFile = 'dmsr.txt'; if(!file_exists($FinalFile)) { file_put_contents($FinalFile, $CurrentTS); }
- $DateStr = "l\, F j\<\s\u\p\>\<\s\m\a\l\l\>S\<\/\s\m\a\l\l\>\<\/\s\u\p\> Y g\:i A";
- $FinalCont = file_get_contents($FinalFile); $FinalContStr = date($DateStr, $FinalCont);
- if(isset($_GET['update'])) { update(); }
- echo "<br>". ltrim($AddlTime, '+') ." added to $FinalContStr<br><br>Update by ". date ($DateStr, strtotime($AddlTime, $FinalCont)). "<br><br><button onclick=window.location.replace('?update')>Update</button><br><br>";
- if($DMSTime < $CurrentTS){ echo "<br><br><strong>It's time for something!</strong>"; unlink($FinalFile); }
- function update(){
- Global $Today, $CurrentTS, $FinalFile; file_put_contents($FinalFile, $CurrentTS); echo "<script>window.location.href = 'dmsr.php'</script>";
- }
- ?></center></body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement