Ipod Touch Coding

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

Seit 2004 hat sich viel getan, der iPod per se ist nicht mehr up-to-date, so wie dieses Forum. Um die Informationen nicht zu verlieren ist das Forum jetzt Read-Only für Gäste, Registrierungen sind aufgrund der hohen Anzahl an Spam-Accounts nichts mehr möglich. Vielen Dank für die schöne Zeit an alle aktiven Nutzer!

  • Ipod Touch Coding

    Huhu :)

    Habe mir auf meinem iPod Touch Clockscreen installiert. Nur das Problem ist, dass die Uhr im 12 AM/ PM Format ist.

    Nur leider kenne ich mich nicht gut genug im Coding aus, um den Code so abzuändern, dass die Uhr im 24h Modus angezeigt wird.

    Hier der Code der Uhr:

    HTML-Quellcode

    1. <html>
    2. <head><title>newclock</title></head>
    3. <style>
    4. SPAN#clock
    5. {
    6. font-family: Helvetica;
    7. color: #ffffff;
    8. font-size: 30px;
    9. text-shadow: #000000 1px 2px 1px;
    10. }
    11. SPAN#ampm
    12. {
    13. font-family: Helvetica;
    14. color: #ffffff;
    15. font-size: 15px;
    16. text-shadow: #000000 1px 2px 1px;
    17. }
    18. SPAN#calendar
    19. {
    20. font-family: Helvetica;
    21. text-align: center;
    22. color: #ffffff;
    23. text-shadow: #000000 1px 2px 1px;
    24. }
    25. </style>
    26. <script type="text/javascript">
    27. function init ( )
    28. {
    29. timeDisplay = document.createTextNode ( "" );
    30. document.getElementById("clock").appendChild ( timeDisplay );
    31. }
    32. function updateClock ( )
    33. {
    34. var currentTime = new Date ( );
    35. var currentHours = currentTime.getHours ( );
    36. var currentMinutes = currentTime.getMinutes ( );
    37. var currentSeconds = currentTime.getSeconds ( );
    38. // Pad the minutes and seconds with leading zeros, if required
    39. currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
    40. currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
    41. // Choose either "AM" or "PM" as appropriate
    42. var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
    43. // Convert the hours component to 12-hour format if needed
    44. currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
    45. // Convert an hours component of "0" to "12"
    46. currentHours = ( currentHours == 0 ) ? 12 : currentHours;
    47. // Compose the string for display
    48. var currentTimeString = currentHours + ":" + currentMinutes;
    49. // Update the time display
    50. document.getElementById("clock").firstChild.nodeValue = currentTimeString;
    51. }
    52. function init2 ( )
    53. {
    54. timeDisplay = document.createTextNode ( "" );
    55. document.getElementById("ampm").appendChild ( timeDisplay );
    56. }
    57. function amPm ( )
    58. {
    59. var currentTime = new Date ( );
    60. var currentHours = currentTime.getHours ( );
    61. // Choose either "AM" or "PM" as appropriate
    62. var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";
    63. // Convert the hours component to 12-hour format if needed
    64. currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;
    65. // Convert an hours component of "0" to "12"
    66. currentHours = ( currentHours == 0 ) ? 12 : currentHours;
    67. // Compose the string for display
    68. var currentTimeString = timeOfDay;
    69. // Update the time display
    70. document.getElementById("ampm").firstChild.nodeValue = currentTimeString;
    71. }
    72. function init3 ( )
    73. {
    74. timeDisplay = document.createTextNode ( "" );
    75. document.getElementById("calendar").appendChild ( timeDisplay );
    76. }
    77. function calendarDate ( )
    78. {
    79. var this_weekday_name_array = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag")
    80. var this_month_name_array = new Array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember") //predefine month names
    81. var this_date_timestamp = new Date()
    82. var this_weekday = this_date_timestamp.getDay()
    83. var this_date = this_date_timestamp.getDate()
    84. var this_month = this_date_timestamp.getMonth()
    85. document.getElementById("calendar").firstChild.nodeValue = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date //concat long date string
    86. }
    87. </script>
    88. </head>
    89. <body bgcolor="black" background="Wallpaper.png">
    90. <table style="position: absolute; top: 0px; left: 0px; width: 320px; height: 130px;" cellspacing="0" cellpadding="0" align="center">
    91. <tr align="center" valign="top" border="0" cellpadding="0">
    92. <td width="320" height="130" background="ClockBar.png" valign="top">
    93. </td>
    94. </tr>
    95. </table>
    96. <table style="position: absolute; top: 32px; left: 0px; width: 320px; height: 461px;" cellspacing="0" cellpadding="0" align="center">
    97. <tr align="center" valign="top" border="0" cellpadding="0">
    98. <td height="10" valign="top">
    99. <span id="clock">
    100. <script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script></span><span id="ampm">
    101. <script language="JavaScript">amPm(); setInterval('amPm()', 1000 )</script>
    102. </span>
    103. </td>
    104. </tr>
    105. <tr align="center">
    106. <td id="date" valign="top" halign="center">
    107. <span id="calendar">
    108. <script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script>
    109. </span>
    110. </td>
    111. </tr>
    112. </table>
    113. </body>
    114. </html>
    Alles anzeigen


    Kennt sich jemand gut genug aus, um mir dabei zu helfen/ auf 24h umzuschreiben?



    lg
  • Hmm. versuch es mal so:

    HTML-Quellcode

    1. <html>
    2. <head><title>newclock</title></head>
    3. <style>
    4. SPAN#clock
    5. {
    6. font-family: Helvetica;
    7. color: #ffffff;
    8. font-size: 30px;
    9. text-shadow: #000000 1px 2px 1px;
    10. }
    11. SPAN#ampm
    12. {
    13. font-family: Helvetica;
    14. color: #ffffff;
    15. font-size: 15px;
    16. text-shadow: #000000 1px 2px 1px;
    17. }
    18. SPAN#calendar
    19. {
    20. font-family: Helvetica;
    21. text-align: center;
    22. color: #ffffff;
    23. text-shadow: #000000 1px 2px 1px;
    24. }
    25. </style>
    26. <script type="text/javascript">
    27. function init ( )
    28. {
    29. timeDisplay = document.createTextNode ( "" );
    30. document.getElementById("clock").appendChild ( timeDisplay );
    31. }
    32. function updateClock ( )
    33. {
    34. var currentTime = new Date ( );
    35. var currentHours = currentTime.getHours ( );
    36. var currentMinutes = currentTime.getMinutes ( );
    37. var currentSeconds = currentTime.getSeconds ( );
    38. // Pad the minutes and seconds with leading zeros, if required
    39. currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
    40. currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;
    41. // Compose the string for display
    42. var currentTimeString = currentHours + ":" + currentMinutes;
    43. // Update the time display
    44. document.getElementById("clock").firstChild.nodeValue = currentTimeString;
    45. }
    46. function init2 ( )
    47. {
    48. timeDisplay = document.createTextNode ( "" );
    49. document.getElementById("ampm").appendChild ( timeDisplay );
    50. }
    51. function init3 ( )
    52. {
    53. timeDisplay = document.createTextNode ( "" );
    54. document.getElementById("calendar").appendChild ( timeDisplay );
    55. }
    56. function calendarDate ( )
    57. {
    58. var this_weekday_name_array = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag")
    59. var this_month_name_array = new Array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember") //predefine month names
    60. var this_date_timestamp = new Date()
    61. var this_weekday = this_date_timestamp.getDay()
    62. var this_date = this_date_timestamp.getDate()
    63. var this_month = this_date_timestamp.getMonth()
    64. document.getElementById("calendar").firstChild.nodeValue = this_weekday_name_array[this_weekday] + ", " + this_month_name_array[this_month] + " " + this_date //concat long date string
    65. }
    66. </script>
    67. </head>
    68. <body bgcolor="black" background="Wallpaper.png">
    69. <table style="position: absolute; top: 0px; left: 0px; width: 320px; height: 130px;" cellspacing="0" cellpadding="0" align="center">
    70. <tr align="center" valign="top" border="0" cellpadding="0">
    71. <td width="320" height="130" background="ClockBar.png" valign="top">
    72. </td>
    73. </tr>
    74. </table>
    75. <table style="position: absolute; top: 32px; left: 0px; width: 320px; height: 461px;" cellspacing="0" cellpadding="0" align="center">
    76. <tr align="center" valign="top" border="0" cellpadding="0">
    77. <td height="10" valign="top">
    78. <span id="clock">
    79. <script language="JavaScript">updateClock(); setInterval('updateClock()', 1000 )</script></span><span id="ampm">
    80. <script language="JavaScript">amPm(); setInterval('amPm()', 1000 )</script>
    81. </span>
    82. </td>
    83. </tr>
    84. <tr align="center">
    85. <td id="date" valign="top" halign="center">
    86. <span id="calendar">
    87. <script language="JavaScript">calendarDate(); setInterval('calendarDate()', 1000 )</script>
    88. </span>
    89. </td>
    90. </tr>
    91. </table>
    92. </body>
    93. </html>
    Alles anzeigen

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Dante93 ()