This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
// Convert RFC2822 date/time string to local date/time in format MM/DD/YYYY HH:MM XM. | |
// Note that PHP has a date format of 'r' that generates RFC2822 format. | |
// Wrap your RFC2822 HTML element with the localdate class and this function converts it. | |
$('.localdate').each(function(){ | |
var o = $(this); | |
var d = new Date(o.text()); | |
var s = d.toLocaleString(); | |
s = s.replace(/(?<!\d)(\d)(?!\d)/g,'0$1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i="$1" | |
i=$((${i//[^0-9]/})) | |
i="$(($i-1+0))" | |
b="$2" | |
b=$((${b//[^0-9]/})) | |
b="$(($b-1+0))" |