ผู้เขียน หัวข้อ: hosxp ใช้บน vista ได้ยัง  (อ่าน 6502 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ subinroied

  • Newbie
  • *
  • กระทู้: 37
  • Respect: 0
    • ดูรายละเอียด
    • www.thawathos.net
hosxp ใช้บน vista ได้ยัง
« เมื่อ: กุมภาพันธ์ 07, 2008, 08:54:36 AM »
0
hosxp ใช้บน vista ได้ยัง ผมสงสัยว่าใช้งานรัน vista แล้วมีปัญหาหรือเปล่า
Master HP Proliant ML 350 G5 Centos
Slave HP Prolint ML150 windows 7
version:ใหม่เสมอเมื่อเธอเปลี่ยนไป
e-mail:admin@thawathos.net
          subinroied@yahoo.com
          triton3070@gmail.com

ออฟไลน์ por

  • Hero Member
  • *****
  • กระทู้: 1,087
  • เพราะว่าเธอคือดวงใจของฉัน
  • Respect: 0
    • ดูรายละเอียด
    • Blog Adminpor
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #1 เมื่อ: กุมภาพันธ์ 07, 2008, 09:12:56 AM »
0
ได้ครับผม
adminpor
ICT @ Office of Public Health.Nakhonsi Province.
Mobile.083-1740976
Office.075-343409 to 106

ออฟไลน์ manoi

  • Hero Member
  • *****
  • กระทู้: 8,669
  • Respect: +170
    • ดูรายละเอียด
    • HOSxP Community Center
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #2 เมื่อ: กุมภาพันธ์ 07, 2008, 11:39:50 AM »
0
ใช้ได้ครับ แต่มีปัญหาเรื่องเดียวใน Vista คือระบบรายงาน รูปแบบการแสดงวันที่จะใช้ eeee เพื่อแทน พ.ศ. ไม่ได้ครับ จะแสดงเป็นปี ค.ศ. แทน

ต้องใช้ Variable และเรียกใช้ function FormatThaiDate ครับ
HOSxP Project Manager / Cheif Developer / BMS MD

ออฟไลน์ naj

  • Hero Member
  • *****
  • กระทู้: 2,449
  • Respect: +8
    • ดูรายละเอียด
    • http://www.luangphopern-hospital.com
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #3 เมื่อ: กรกฎาคม 17, 2009, 21:37:24 PM »
0
ใช้ได้ครับ แต่มีปัญหาเรื่องเดียวใน Vista คือระบบรายงาน รูปแบบการแสดงวันที่จะใช้ eeee เพื่อแทน พ.ศ. ไม่ได้ครับ จะแสดงเป็นปี ค.ศ. แทน

ต้องใช้ Variable และเรียกใช้ function FormatThaiDate ครับ
ลองตรวจสอบ ใน HOSxP 3.52.7.17 ยังไม่มีใน Variable ครับ
Yindee And Tan

doramon

  • บุคคลทั่วไป
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #4 เมื่อ: กรกฎาคม 17, 2009, 22:30:28 PM »
0
Value := formatThaiDate('dd/mm/eeee',date);

function FormatThaiDate(options: string; FDate: TdateTime): string;
var
  sd: string;
  opt: string;
begin
  if (options = 'ddmmyy') then
    result := formatdatetime('dd', fdate) +
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymmdd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate) + formatdatetime('dd', fdate)
  else if options = 'dd/mm/yy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/ee' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/yyyy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd/mm/yyyy hh:nn:ss' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4) + ' '
      +
      formatdatetime('hh:nn:ss', fdate)
  else if options = 'yy-mm-dd hh:nn:ss.zzz' then
    result := formatdatetime('yy-mm-dd hh:nn:ss.zzz', fdate)
  else if options = 'dd-mm-yyyy' then
    result := formatdatetime('dd', fdate) + '-' +
      formatdatetime('mm', fdate) + '-' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'd/m/yyyy' then
    result := formatdatetime('d', fdate) + '/' +
      formatdatetime('m', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd mmmm yyyy' then
    result := formatdatetime('dd', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd m yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('m', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'd mmmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mmmm yyyy' then
    result := formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yyyy' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yy/mm/dd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate) + '/' + formatdatetime('dd', fdate)
  else if options = 'mm/yy' then
    result := formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yy/mm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate)

  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)

  else if options = 'mmyy' then
    result :=
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm/ee' then
    result :=
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'eemmddhhnnss' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mmddhhnnss', fdate)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)

  else if options = 'eeee' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)

  else if pos('ee', options) = 0 then
  begin
    if pos('yyyy', options) > 0 then
    begin
      sd := formatthaidate('eeee', fdate);
      opt := replacestr(options, 'yyyy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('yy', options) > 0 then
    begin
      sd := formatthaidate('ee', fdate);
      opt := replacestr(options, 'yy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('ee', options) > 0 then
    begin
      if pos('eeee', options) > 0 then
      begin
        sd := formatthaidate('eeee', fdate);
        opt := replacestr(options, 'eeee', sd);
      end
      else
      begin
        sd := formatthaidate('ee', fdate);
        opt := replacestr(options, 'ee', sd);
      end;

      result := sysutils.formatdatetime(opt, fdate);

    end
    else
    begin
      result := sysutils.formatdatetime(options, fdate);

    end;

    //result := formatdatetime(options, fdate);
  end

  else
    Messagedlg('Options not found for Format Thaidate function ! ' + options,
      mterror, [mbok], 0);
end;

ออฟไลน์ thannawe

  • Hero Member
  • *****
  • กระทู้: 2,904
  • Respect: +8
    • ดูรายละเอียด
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #5 เมื่อ: กรกฎาคม 17, 2009, 22:47:28 PM »
0
โอ๊ย   !! มึนทั้ง สองกระทู้  :D ;) :D
กิจจา ชาญธัญกรรม
นักวิชาการคอมพิวเตอร์ชำนาญการ รพ.โพธาราม จ.ราชบุรี
็HOSxP XE

ออฟไลน์ wiphusit

  • Hero Member
  • *****
  • กระทู้: 2,426
  • ยอดกมล
  • Respect: +4
    • ดูรายละเอียด
    • โรงพยาบาลทับปุด
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #6 เมื่อ: กรกฎาคม 20, 2009, 09:45:53 AM »
0
Value := formatThaiDate('dd/mm/eeee',date);

function FormatThaiDate(options: string; FDate: TdateTime): string;
var
  sd: string;
  opt: string;
begin
  if (options = 'ddmmyy') then
    result := formatdatetime('dd', fdate) +
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymmdd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate) + formatdatetime('dd', fdate)
  else if options = 'dd/mm/yy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/ee' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/yyyy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd/mm/yyyy hh:nn:ss' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4) + ' '
      +
      formatdatetime('hh:nn:ss', fdate)
  else if options = 'yy-mm-dd hh:nn:ss.zzz' then
    result := formatdatetime('yy-mm-dd hh:nn:ss.zzz', fdate)
  else if options = 'dd-mm-yyyy' then
    result := formatdatetime('dd', fdate) + '-' +
      formatdatetime('mm', fdate) + '-' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'd/m/yyyy' then
    result := formatdatetime('d', fdate) + '/' +
      formatdatetime('m', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd mmmm yyyy' then
    result := formatdatetime('dd', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd m yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('m', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'd mmmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mmmm yyyy' then
    result := formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yyyy' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yy/mm/dd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate) + '/' + formatdatetime('dd', fdate)
  else if options = 'mm/yy' then
    result := formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yy/mm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate)

  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)

  else if options = 'mmyy' then
    result :=
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm/ee' then
    result :=
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'eemmddhhnnss' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mmddhhnnss', fdate)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)

  else if options = 'eeee' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)

  else if pos('ee', options) = 0 then
  begin
    if pos('yyyy', options) > 0 then
    begin
      sd := formatthaidate('eeee', fdate);
      opt := replacestr(options, 'yyyy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('yy', options) > 0 then
    begin
      sd := formatthaidate('ee', fdate);
      opt := replacestr(options, 'yy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('ee', options) > 0 then
    begin
      if pos('eeee', options) > 0 then
      begin
        sd := formatthaidate('eeee', fdate);
        opt := replacestr(options, 'eeee', sd);
      end
      else
      begin
        sd := formatthaidate('ee', fdate);
        opt := replacestr(options, 'ee', sd);
      end;

      result := sysutils.formatdatetime(opt, fdate);

    end
    else
    begin
      result := sysutils.formatdatetime(options, fdate);

    end;

    //result := formatdatetime(options, fdate);
  end

  else
    Messagedlg('Options not found for Format Thaidate function ! ' + options,
      mterror, [mbok], 0);
end;
ทำไงเหลอครับ
วิภูษิต  คงแก้ว เจ้าพนักงานเครื่องคอมพิวเตอร์ 
โรงพยาบาลทับปุด
อำเภอทับปุด จ.พังงา 82180
โทร 0-7659-9019 ต่อ 117,101
โทรสาร 0-7659-9115
Thailand.

ออฟไลน์ bannok

  • Hero Member
  • *****
  • กระทู้: 763
  • Respect: +8
    • ดูรายละเอียด
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #7 เมื่อ: กรกฎาคม 20, 2009, 09:54:33 AM »
0
ใช้ได้ครับ ตอนนี้ก็ใช้อยู่ครับ
Somchai  Lenyee  Promkiri Hospital  tel 075396123 ต่อ 165
เมล์ arsan_2005@hotmail.com
server IBM SYSTEM x3650M5  ram 32 G.
server IBM SYSTEM x3500M3  ram 16 G.
 Hosxp 3.63.3.10
OS:centos 7 mysql 10.1.10 MariaDB

ออฟไลน์ perjer4675

  • Full Member
  • ***
  • กระทู้: 221
  • ไม่มีใครรู้ใจเราเท่ากับเรารู้ใจตัวเอง
  • Respect: +2
    • ดูรายละเอียด
    • ไทย - เพ้อเจ้อ
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #8 เมื่อ: กรกฎาคม 20, 2009, 10:36:28 AM »
0
 ;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
ชื่อ นาย เกรียงไกร  ทาฤทธิ์
โรงพยาบาลสมุทรปราการ
ยังไม่ได้ทำอย่าบอกว่า ทำไม่ได้
mail perjer4675[at]hotmail.com
เว็บส่วนตัว www.perjer.net

ออฟไลน์ thannawe

  • Hero Member
  • *****
  • กระทู้: 2,904
  • Respect: +8
    • ดูรายละเอียด
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #9 เมื่อ: กรกฎาคม 20, 2009, 10:52:56 AM »
0
;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
ผมใช้อยู่ แต่แก้ไม่เป็นครับ สอนหน่อยครับ ท่านperjer  :D ;D
กิจจา ชาญธัญกรรม
นักวิชาการคอมพิวเตอร์ชำนาญการ รพ.โพธาราม จ.ราชบุรี
็HOSxP XE

ออฟไลน์ udomchok

  • Hero Member
  • *****
  • กระทู้: 8,347
  • Respect: +589
    • ดูรายละเอียด
    • ร.พ.สมเด็จพระสังฆราช องค์ที่ 17
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #10 เมื่อ: กรกฎาคม 20, 2009, 11:20:22 AM »
0
;D ;D ผมก็ใช้ได้ครับ แต่ก็เหมือนที่อาจารย์บอกครับ มีปัญหาที่ พศ. ครับแต่ก็แก้ได้นะครับ
ผมใช้อยู่ แต่แก้ไม่เป็นครับ สอนหน่อยครับ ท่านperjer  :D ;D
ก็ทำตามที่ อ.อ๊อด บอกไง
ทำด้วยหัวใจร.พ.สมเด็จพระสังฆราช องค์ที่ 17 อ.สองพี่น้อง จ.สุพรรณบุรี
อบรมโดย BMS Team เมื่อ พ.ย. 49 ขึ้นระบบห้องบัตรเมื่อ X'Mas 2007
2008 : X-Ray กายภาพบำบัด แพทย์แผนไทย กิจกรรมบำบัด OPD ตา
2009 : ทันตกรรม ห้องตรวจตา OPD (พยาบาลและห้องตรวจแพทย์บางห้อง)

ออฟไลน์ thannawe

  • Hero Member
  • *****
  • กระทู้: 2,904
  • Respect: +8
    • ดูรายละเอียด
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #11 เมื่อ: กรกฎาคม 20, 2009, 11:26:19 AM »
0
copy แล้วเอาไปใส่ ไว้ที่ไหนครับ run ยังไงครับ
กิจจา ชาญธัญกรรม
นักวิชาการคอมพิวเตอร์ชำนาญการ รพ.โพธาราม จ.ราชบุรี
็HOSxP XE

ออฟไลน์ อู๋kokha50

  • Hero Member
  • *****
  • กระทู้: 1,169
  • อยากได้ความรู้Hosxpต้องลงมือเรียนรู้
  • Respect: 0
    • ดูรายละเอียด
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #12 เมื่อ: กรกฎาคม 20, 2009, 13:17:10 PM »
0
ปัญหาเป็นแบบนี้ ครับ

http://hosxp.net/index.php?option=com_smf&Itemid=28&topic=6479.0

วิธีแก้ เลิกใช้ Vista กลับมาใช้ Xp ที่จุดนัด
โรงพยาบาลเกาะคา จังหวัดลำปาง โทร 054281393 ต่อ 128 Server : HP Proliant ML150 G3 Xeon 2.0 Ram 16 G  HDDSATA 160 G 2 ตัว CentOS 5.2 Linux MySQL 5.1.30-4percona
HosXp Version 3.55.5.8b
Client : winXP,  Version 3.55.5.8b
 ขึ้นระบบ 1 พ.ค.50

ออฟไลน์ อู๋kokha50

  • Hero Member
  • *****
  • กระทู้: 1,169
  • อยากได้ความรู้Hosxpต้องลงมือเรียนรู้
  • Respect: 0
    • ดูรายละเอียด
Re: hosxp ใช้บน vista ได้ยัง
« ตอบกลับ #13 เมื่อ: กรกฎาคม 20, 2009, 13:31:00 PM »
0
Value := formatThaiDate('dd/mm/eeee',date);

function FormatThaiDate(options: string; FDate: TdateTime): string;
var
  sd: string;
  opt: string;
begin
  if (options = 'ddmmyy') then
    result := formatdatetime('dd', fdate) +
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymmdd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate) + formatdatetime('dd', fdate)
  else if options = 'dd/mm/yy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/ee' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'dd/mm/yyyy' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd/mm/yyyy hh:nn:ss' then
    result := formatdatetime('dd', fdate) + '/' +
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4) + ' '
      +
      formatdatetime('hh:nn:ss', fdate)
  else if options = 'yy-mm-dd hh:nn:ss.zzz' then
    result := formatdatetime('yy-mm-dd hh:nn:ss.zzz', fdate)
  else if options = 'dd-mm-yyyy' then
    result := formatdatetime('dd', fdate) + '-' +
      formatdatetime('mm', fdate) + '-' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'd/m/yyyy' then
    result := formatdatetime('d', fdate) + '/' +
      formatdatetime('m', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 1, 4)
  else if options = 'dd mmmm yyyy' then
    result := formatdatetime('dd', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd m yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('m', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'd mmmm yy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmmm', fdate) + ' ' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mmmm yyyy' then
    result := formatdatetime('mmmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'd mmm yyyy' then
    result := formatdatetime('d', fdate) + ' ' +
      formatdatetime('mmm', fdate) + ' ' +
      inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yyyy' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)
  else if options = 'yy/mm/dd' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate) + '/' + formatdatetime('dd', fdate)
  else if options = 'mm/yy' then
    result := formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yy/mm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      '/' + formatdatetime('mm', fdate)

  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)

  else if options = 'mmyy' then
    result :=
      formatdatetime('mm', fdate) +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm/ee' then
    result :=
      formatdatetime('mm', fdate) + '/' +
      copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'yymm' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)
  else if options = 'yy' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'ee' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
  else if options = 'eemmddhhnnss' then
    result := copy(inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543), 3, 2)
      +
      formatdatetime('mmddhhnnss', fdate)
  else if options = 'mm' then
    result := formatdatetime('mm', fdate)

  else if options = 'eeee' then
    result := inttostr(strtoint(formatdatetime('yyyy', fdate)) + 543)

  else if pos('ee', options) = 0 then
  begin
    if pos('yyyy', options) > 0 then
    begin
      sd := formatthaidate('eeee', fdate);
      opt := replacestr(options, 'yyyy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('yy', options) > 0 then
    begin
      sd := formatthaidate('ee', fdate);
      opt := replacestr(options, 'yy', sd);
      result := sysutils.formatdatetime(opt, fdate);
    end
    else if pos('ee', options) > 0 then
    begin
      if pos('eeee', options) > 0 then
      begin
        sd := formatthaidate('eeee', fdate);
        opt := replacestr(options, 'eeee', sd);
      end
      else
      begin
        sd := formatthaidate('ee', fdate);
        opt := replacestr(options, 'ee', sd);
      end;

      result := sysutils.formatdatetime(opt, fdate);

    end
    else
    begin
      result := sysutils.formatdatetime(options, fdate);

    end;

    //result := formatdatetime(options, fdate);
  end

  else
    Messagedlg('Options not found for Format Thaidate function ! ' + options,
      mterror, [mbok], 0);
end;

อีกวิธีครับ copy ของ อ.ออ๊ด ไปใส่ใน Variable ครับ อ.อ๊อดใช้สูตร คศ+ 543 ครับ ใช้ได้เหมือนกัน
โรงพยาบาลเกาะคา จังหวัดลำปาง โทร 054281393 ต่อ 128 Server : HP Proliant ML150 G3 Xeon 2.0 Ram 16 G  HDDSATA 160 G 2 ตัว CentOS 5.2 Linux MySQL 5.1.30-4percona
HosXp Version 3.55.5.8b
Client : winXP,  Version 3.55.5.8b
 ขึ้นระบบ 1 พ.ค.50