{"id":360,"date":"2025-11-13T18:10:21","date_gmt":"2025-11-13T23:10:21","guid":{"rendered":"https:\/\/capncrusty.com\/?page_id=360"},"modified":"2025-11-13T19:42:05","modified_gmt":"2025-11-14T00:42:05","slug":"dayz-time-calculator","status":"publish","type":"page","link":"https:\/\/capncrusty.com\/index.php\/dayz-time-calculator\/","title":{"rendered":"DayZ Time Calculator"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"360\" class=\"elementor elementor-360\">\n\t\t\t\t<div class=\"elementor-element elementor-element-9adc420 e-flex e-con-boxed e-con e-parent\" data-id=\"9adc420\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7d3e8b1 elementor-widget elementor-widget-shortcode\" data-id=\"7d3e8b1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\">        <div class=\"dayz-time-calculator\">\n            <style>\n                .dayz-calc-container {\n                    max-width: 600px;\n                    margin: 20px auto;\n                    padding: 20px;\n                    border: 1px solid #ddd;\n                    border-radius: 8px;\n                    background: #f9f9f9;\n                }\n                .dayz-calc-row {\n                    margin: 15px 0;\n                    display: flex;\n                    align-items: center;\n                }\n                .dayz-calc-label {\n                    width: 200px;\n                    font-weight: bold;\n                }\n                .dayz-calc-input {\n                    padding: 8px;\n                    border: 1px solid #ccc;\n                    border-radius: 4px;\n                    width: 120px;\n                }\n                .dayz-calc-button {\n                    background: #0073aa;\n                    color: white;\n                    padding: 10px 20px;\n                    border: none;\n                    border-radius: 4px;\n                    cursor: pointer;\n                    font-size: 16px;\n                }\n                .dayz-calc-button:hover {\n                    background: #005a87;\n                }\n                .dayz-calc-results {\n                    margin-top: 20px;\n                    padding: 15px;\n                    background: white;\n                    border-radius: 4px;\n                    border-left: 4px solid #0073aa;\n                }\n                .dayz-calc-error {\n                    color: #d63638;\n                    margin-top: 10px;\n                }\n                .dayz-calc-code {\n                    background: #f1f1f1;\n                    padding: 10px;\n                    border-radius: 4px;\n                    font-family: monospace;\n                    margin: 5px 0;\n                }\n            <\/style>\n            \n            <div class=\"dayz-calc-container\">\n                <h3>DayZ Server Time Calculator<\/h3>\n                \n                <div class=\"dayz-calc-row\">\n                    <div class=\"dayz-calc-label\">Desired Day Length (hours):<\/div>\n                    <input type=\"number\" id=\"day_length\" class=\"dayz-calc-input\" value=\"2\" step=\"0.1\" min=\"0.5\" max=\"24\">\n                <\/div>\n                \n                <div class=\"dayz-calc-row\">\n                    <div class=\"dayz-calc-label\">Desired Night Length (hours):<\/div>\n                    <input type=\"number\" id=\"night_length\" class=\"dayz-calc-input\" value=\"0.5\" step=\"0.1\" min=\"0.1\" max=\"24\">\n                <\/div>\n                \n                <button id=\"calculate_btn\" class=\"dayz-calc-button\">Calculate Settings<\/button>\n                \n                <div id=\"results\" class=\"dayz-calc-results\" style=\"display: none;\">\n                    <h4>Recommended Settings:<\/h4>\n                    <div class=\"dayz-calc-code\" id=\"base_accel\"><\/div>\n                    <div class=\"dayz-calc-code\" id=\"night_accel\"><\/div>\n                    <div id=\"explanation\" style=\"margin-top: 10px; font-size: 14px; color: #666;\"><\/div>\n                <\/div>\n                \n                <div id=\"error_msg\" class=\"dayz-calc-error\" style=\"display: none;\"><\/div>\n            <\/div>\n\n            <script type=\"text\/javascript\">\n            jQuery(document).ready(function($) {\n                $('#calculate_btn').on('click', function() {\n                    \/\/ Get values\n                    var dayLength = parseFloat($('#day_length').val());\n                    var nightLength = parseFloat($('#night_length').val());\n                    \n                    \/\/ Validate inputs\n                    if (isNaN(dayLength) || isNaN(nightLength)) {\n                        showError('Please enter valid numbers for both day and night length.');\n                        return;\n                    }\n                    \n                    if (dayLength <= 0 || nightLength <= 0) {\n                        showError('Day and night length must be greater than 0.');\n                        return;\n                    }\n                    \n                    \/\/ Calculate settings\n                    var baseAcceleration = 12 \/ dayLength; \/\/ 12 in-game hours for day\n                    var nightAcceleration = dayLength \/ nightLength;\n                    \n                    \/\/ Display results\n                    $('#base_accel').text('serverTimeAcceleration = ' + baseAcceleration.toFixed(2) + ';');\n                    $('#night_accel').text('serverNightTimeAcceleration = ' + nightAcceleration.toFixed(2) + ';');\n                    \n                    var explanation = 'With these settings:' +\n                        '<br>\u2022 Day will last: ' + dayLength + ' real-time hours' +\n                        '<br>\u2022 Night will last: ' + nightLength + ' real-time hours' +\n                        '<br>\u2022 Full day\/night cycle: ' + (dayLength + nightLength).toFixed(1) + ' hours';\n                    \n                    $('#explanation').html(explanation);\n                    $('#results').show();\n                    $('#error_msg').hide();\n                });\n                \n                function showError(message) {\n                    $('#error_msg').text(message).show();\n                    $('#results').hide();\n                }\n            });\n            <\/script>\n        <\/div>\n        <\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-9d4e3bf e-flex e-con-boxed e-con e-parent\" data-id=\"9d4e3bf\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-4265bec elementor-widget elementor-widget-spacer\" data-id=\"4265bec\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"spacer.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-spacer\">\n\t\t\t<div class=\"elementor-spacer-inner\"><\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"class_list":["post-360","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/capncrusty.com\/index.php\/wp-json\/wp\/v2\/pages\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/capncrusty.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/capncrusty.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/capncrusty.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/capncrusty.com\/index.php\/wp-json\/wp\/v2\/comments?post=360"}],"version-history":[{"count":10,"href":"https:\/\/capncrusty.com\/index.php\/wp-json\/wp\/v2\/pages\/360\/revisions"}],"predecessor-version":[{"id":383,"href":"https:\/\/capncrusty.com\/index.php\/wp-json\/wp\/v2\/pages\/360\/revisions\/383"}],"wp:attachment":[{"href":"https:\/\/capncrusty.com\/index.php\/wp-json\/wp\/v2\/media?parent=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}