Archive

Archive for October, 2011

How to header CSV to UTF-8

October 26, 2011 Leave a comment
header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');
header('Content-Disposition: attachment; filename=Customers_Export.csv');
echo "\xEF\xBB\xBF"; // UTF-8 BOM
Categories: PHP Tags: , ,

Facebook Auto Post

October 18, 2011 Leave a comment

Postsible help you to manage your content for Fan Page,Group and App Profile Page. You can post status,link and album at time and date you have plan.

Website

 

 

Categories: ETC Tags: , , , ,

Turn off caching for JavaScript files on Firefox

October 14, 2011 Leave a comment

พิมพ์ about:config ในช่อง Url

ค้นหา network.http.use-cache เปลี่ยนเป็น false
ค้นหา browser.cache.offline.enable เปลี่ยนเป็น false

Categories: ETC Tags: , , ,

[Javascript] Unixtime to Datetime and Datetime to Unixtime

October 14, 2011 Leave a comment

// อันนี้ Date Time => Unixtime
var d = Date.parse(“10/15/2011 02:00:00”);
// format ในตัวอย่างเป็น mm/dd/yyyy hh:ii:ss
เอาค่า d หาร 1000 ได้เท่ากับ Unix time บน MySQL เพราะ Java เก็บเป็นมิลลิวินาที
กรณีเอา Unixtime บน MySQL ก็ต้องเอามาคูณ 1000 ก่อนเหมือนกัน ก่อนนำมาใช้

// หา Date Month Year วันที่ โดย unixtime อย่าลืม 000 ที่เปนมิลลิวินาที

// ข้างล่างเป็น Unixtime => Date Time
// Date
var d=new Date(1318791600000);
document.write(d.getDate(1318791600000));
// return 17 [1-31]

// Month
var d=new Date(1318791600000);
document.write(d.getMonth(1318791600000)+1);
// return 10 ต้องบวก 1 เพราะ มัน 0-11 [0-11]

var d=new Date(1318791600000);
document.write(d.getFullYear(1318791600000));
// return 2011 [four digits]

var d=new Date(1318791600000);
document.write(d.getHours(1318791600000));
// return 2 [0-23]

var d=new Date(1318791600000);
document.write(d.getMinutes(1318791600000));
// return 0 [0-59]

นี่เป็นตัวอย่างฟังก์ชั่นง่าย ๆ ของ Javascript เกี่ยวกับ Date Time
ข้อมูลเพิ่มเติม http://www.w3schools.com/jsref/jsref_obj_date.asp

Categories: Jquery Tags: , , ,

Steve Jobs ผู้เป็นแรงบรรดาลใจ เอาไปเป็น Wallpaper กระตุ้น

October 6, 2011 Leave a comment

Steve Jobs Wallpaper

Categories: ETC Tags: ,