Delphi : Date and Time Format from ddd-mm-yy to mm/dd/yyyy

i had a case a few weeks back of a problem where the computer needs to have a date format of dd-mmm-yy which in today’s date is 21-Feb-18. What i need is for the program to act the same as it was with the format 02/21/2018.

After digging data, i came across these gems of a find. It’s so short and so obvious, i hope this code can help somebody out

Enjoy

Coffee Cup

 

 

 

{
CurrencyString, CurrencyFormat, NegCurrFormat, ThousandSeparator,
DecimalSeparator, CurrencyDecimals, DateSeparator, ShortDateFormat,
LongDateFormat, TimeSeparator, TimeAMString, TimePMString,
ShortTimeFormat, LongTimeFormat

//Change COMPUTER date and time
SetLocaleInfo(GetThreadLocale, LOCALE_SSHORTDATE, ‘MM/dd/yyyy’);
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0,
SMTO_ABORTIFHUNG, 1000, PDWord(Nil)^);

//Change formatting from within the APPLICATION
DateSeparator := ‘/’;
ShortDateFormat := ‘MM/dd/yyyy’;

SetLocaleInfo(DefaultLCID, LOCALE_SSHORTDATE, ‘m/d/yy’) (short form) and
SetLocaleInfo(DefaultLCID, LOCALE_SLONGDATE, ‘mmmm d, yyyy’) (long form)

SetLocaleInfo(GetThreadLocale, LOCALE_SSHORTDATE, ‘MM/dd/yyyy’);
SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0,
SMTO_ABORTIFHUNG, 1000, PDWord(Nil)^);
}

// Change the display formatting
DateSeparator := ‘/’;
ShortDateFormat := ‘MM/dd/yyyy’;

Borland Database Engine (BDE) Config Disappears

Being a programmer for so many years, i have been accustomed to a adapt to different circumstances and scenarios. Here are my top reasons why Borland Database Engine (BDE) profiles seem to dissapear.

* Windows User Account Control Settings
Now this one is the first one on the list. When you modify the security level from medium to low, this is the first one in my list.

* Deepfreeze Software or Any Software that Restores Back Windows
This one is quite obvious. deepfreeze is a software that when you restart your pc, it reverts back to the way it was. Yeah, who knows, you might be a victim of one.

* Windows 10 Update
Now this one beats the cake. So far, when Windows downloads an update to yur pc, be sure that he meddled with the settings. Well, it’s a bit off topic but my system date and time, Windows keep setting it to automatically update. This feature i usually turn off because i set the time minutes advance.

I created a youtube video to show some pictures of what i mean

Enjoy

Coffee Cup

https://youtu.be/sAamLzyf_yk

Hyper Threading to Single Thread

If you are looking for a software that will bridge your delphi application and your interbase application that is freeware, look no further. I found this program while researching since i cannot install delphi during deployment because it needs a serial key. Now, you don’t need to.

Here are the links. Please try only one. They all link to the same file. But just in case one of the links fail, at least you have other options to reach them.

http://www.indishare.me/79wawf5nnord

http://verified-download.com/file/36L9866

https://uploadocean.com/4r1mzjqiz7fw

https://dailyuploads.net/8uksbvfx4apm

https://www.megaupload.us/1NlH/20180218_Interbase_Hyper_Threading_to_SIngle_Thread.7z

http://agileurbia.com/CVW

 

 

Interbase Server 6.01 IBServer601

If you are looking for a software that will bridge your delphi application and your interbase application that is freeware, look no further. I found this program while researching since i cannot install delphi during deployment because it needs a serial key. Now, you don’t need to.

Here are the links. Please try only one. They all link to the same file. But just in case one of the links fail, at least you have other options to reach them.

http://www.indishare.me/crwiuhtl4orc

http://reliablefiles.com/file/36L9867

https://uploadocean.com/4gc6yik3rkk3

https://dailyuploads.net/xiusw41u9hs2

https://www.megaupload.us/1NlI/20180218_Interbase_Server_6.01_IBServer601.7z

http://agileurbia.com/CX4

 

 

Interbase : IB Client Freeware

If you are looking for a software that will bridge your delphi application and your interbase application that is freeware, look no further. I found this IB client program while researching since i cannot install delphi during deployment because it needs a serial key. Now, you don’t need to.

Here are the links. Please try only one. They all link to the same file. But just in case one of the links fail, at least you have other options to reach them.

http://www.indishare.me/r56pgf38bysj

http://filerack.net/file/36L9865

https://uploadocean.com/04pdw1dr0nxw

https://dailyuploads.net/h38drei09qth

https://www.megaupload.us/1NlG/20180218_Interbase_Client_IB.7z

http://agileurbia.com/CUh

 

Delphi : Borland Database Engine (BDE) Freeware

If you are looking for a software that will bridge your delphi application and your interbase application that is freeware, look no further. I found this program while researching since i cannot install delphi during deployment because it needs a serial key. Now, you don’t need to.

Here are the links. Please try only one. They all link to the same file. But just in case one of the links fail, at least you have other options to reach them.

http://www.indishare.me/9eoytymglcyf

http://downloadity.net/file/36L9864

https://uploadocean.com/be2vntyuw74j

https://dailyuploads.net/ywnlecobuaeq

https://www.megaupload.us/1NlF/20180218_Borland_Database_Engine_BDE.7z

http://agileurbia.com/CQH

 

Delphi : Parse or Explode a string based on a parameter field

this is a small code that i put together to convert the date time format of “2017-11-18 08:25” to the date time format that i am using right now which is “11/18/2017 8:25:00 AM”.  For now i will make due with this one and so far it works.

enjoy,

coffee cup

 

 

var
vDATE : TDateTime;
vPOS : Integer;
vList : TStrings;
begin
//convert from 2017-11-18 08:25
//convert to 11/18/2017 8:25:00 AM

vPOS := POS(‘ ‘, edtDATE_ORIG.Text);

edtDATE_CHOP.Text := Trim(Copy(edtDATE_ORIG.Text,1, vPOS));
edtTIME_CHOP.Text := Trim(Copy(edtDATE_ORIG.Text,vPOS + 1, 100));

vList := TStringList.Create;
try
ExtractStrings([‘-‘], [], PChar(edtDATE_CHOP.Text), vList);

edtYEAR.Text := vList.Strings[0];
edtMONTH.Text := vList.Strings[1];
edtDAY.Text := vList.Strings[2];

//year, month, day
edtDATE_CURR.Text := edtMONTH.Text + ‘/’ + edtDAY.Text + ‘/’ + edtYEAR.Text;
vDATE := StrToDateTime(edtDATE_CURR.Text + ‘ ‘ + edtTIME_CHOP.Text);
edtDATETIME.Text := DateTimeToStr(vDATE);

finally
vList.Free;
end;

Windows 10, 8, 7 : alt+printscreen does not work. Solved

after i experienced this, windows 10 just updated again (after I disabled it) i had doubts if windows managed to disable this one. i tried to look at a lot of blogs and forums but so far, a lot of them suggested changing the keyboard. funny for me, i am using a laptop.

then it just hit me. i just downloaded software for screen capture and it downed on me that the software might be catching the keystrokes such as the alt+printscreen. when i closed the app, the alt+printscreen now works.

i just solved my own dilemma. hope somebody learns from this.

enjoy

coffee cup

Interbase : How to get the weekday , month, year and day from timestamp

its amazing that a lot of the functions needed in our daily lives get embedded to a lot of software’s out there.

This is a case that i needed to generate employees who went in on Monday. I was able to dig out these great finds.

Enjoy

Coffee Cup

 

The data type of EXTRACT() expressions depends on the specific part being extracted:

Extract Resulting
data type
Representing
YEAR SMALLINT Year, range 0-5400
MONTH SMALLINT Month, range 1-12
DAY SMALLINT Day, range 1-31
HOUR SMALLINT Hour, range 1-23
MINUTE SMALLINT Minute, range 1-59
SECOND DECIMAL(6,4) Second, range 0-59.9999
WEEKDAY SMALLINT Day of the week, range 0-6
(0 = Sunday, 1 = Monday, and so on)
YEARDAY SMALLINT Day of the year, range 1-366
SELECT EXTRACT (YEAR FROM timestamp_fld) FROM table_name;
=======
1999
SELECT EXTRACT (YEAR FROM timestamp_fld) FROM table_name;
=======
1999
SELECT EXTRACT (MONTH FROM timestamp_fld) FROM table_name;
=======
6
SELECT EXTRACT (DAY FROM timestamp_fld) FROM table_name;
=======
25
SELECT EXTRACT (MINUTE FROM timestamp_fld) FROM table_name;
=======
24
SELECT EXTRACT (SECOND FROM timestamp_fld) FROM table_name;
============
35.0000
SELECT EXTRACT (WEEKDAY FROM timestamp_fld) FROM table_name;
=======
5
SELECT EXTRACT (YEARDAY FROM timestamp_fld) FROM table_name;
=======
175
SELECT EXTRACT (MONTH FROM timestamp_fld) ||
'-' || EXTRACT (DAY FROM timestamp_fld) ||
'-' || EXTRACT (YEAR FROM timestamp_fld) FROM table_name;
====================
6-25-1999

Source : http://docwiki.embarcadero.com/InterBase/XE7/en/Extracting_Date_and_Time_Information