FunctionImagingInPascal/gui/utils.pas

35 lines
561 B
ObjectPascal
Raw Normal View History

2020-04-26 16:08:03 +03:00
unit utils;
interface
uses SysUtils;
function wrapFirstLetter(s: string; wrapper: string): string;
function getTimestamp(): int64;
implementation
function wrapFirstLetter(s: string; wrapper: string): string;
var
i: integer;
ts: string;
begin
ts := '';
for i := 2 to length(s) do begin
ts := ts + s[i];
end;
s := wrapper + s[1] + wrapper + ts;
wrapFirstLetter := s;
end;
function GetTimestamp(): int64;
var
ts: TTimeStamp;
begin
ts := DateTimeToTimestamp(Now());
GetTimestamp := ts.time + ts.date * 24 * 60 * 60 * 1000;
end;
end.