flat assembler
Message board for the users of flat assembler.
Index
> Main > Anyway to get time in FASM. (Nope! It's the preprocessor!) |
Author |
|
sid123 15 Mar 2014, 16:01
Yeah, so is there any way I can tell FASM to put the current time and date in my data section automatically?
Although it isn't of much use, but it does help when you want to tell the user like: Code: <PROGRAM NAME> Compiled on XX:XX:XX, XX/XX/XXXX Like, Code: db %%SYSTEM_TIME db %%SYSTEM_DATE Which will put the system time value and system date value as null-terminated strings in those places. _________________ "Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X XD |
|||
15 Mar 2014, 16:01 |
|
JohnFound 15 Mar 2014, 17:33
%t constant in FASM is always equal to the current time. One example of use: version.inc
|
|||
15 Mar 2014, 17:33 |
|
revolution 15 Mar 2014, 20:25
Actually %t is a variable. It can change each time your source reads it and on each pass.
|
|||
15 Mar 2014, 20:25 |
|
JohnFound 16 Mar 2014, 06:40
revolution, yes actually.
|
|||
16 Mar 2014, 06:40 |
|
sid123 16 Mar 2014, 07:24
Is it string/bcd/integer ?
|
|||
16 Mar 2014, 07:24 |
|
JohnFound 16 Mar 2014, 07:53
It is an integer number - UNIX time format.
|
|||
16 Mar 2014, 07:53 |
|
revolution 16 Mar 2014, 10:35
JohnFound wrote: version.inc Access by spiders and robots is forbidden |
|||
16 Mar 2014, 10:35 |
|
sid123 16 Mar 2014, 11:45
@JohnFound: Thanks
@rev What? Works fine for me. This mean..s.. Th....a..t WE HAVE FINALLY FOUND WHO REVOLUTION IS! A BOT! |
|||
16 Mar 2014, 11:45 |
|
LocoDelAssembly 16 Mar 2014, 19:25
Fossil's antibot protection discussion continues here.
|
|||
16 Mar 2014, 19:25 |
|
gens 18 Mar 2015, 19:09
sid123 wrote: @JohnFound: Thanks maybe revolution is a spider Last edited by gens on 19 Mar 2015, 15:21; edited 1 time in total |
|||
18 Mar 2015, 19:09 |
|
JohnFound 18 Mar 2015, 19:15
@HaHaAnonymous, did you read the source from the second point in this thread? %T is just a number - the time/date in unix format. It can be converted in whatever format you need by some macros and FASM equations. (Usually the needed format is some kind of string, but there is no any limit)
Or I didn't understood you correctly? Please, provide some example then. |
|||
18 Mar 2015, 19:15 |
|
HaHaAnonymous 18 Mar 2015, 19:45
Quote:
I do not know how to write macros (not interested in learning it as well). D: If you can provide one that could handle all possible formats of date... Please, then do it. :D Otherwise, I will be using the good and old backup/search/replace/compile/restore alternative I described in my previous post. Again, I apologize for any inconvenience (if any). Thank you! |
|||
18 Mar 2015, 19:45 |
|
JohnFound 18 Mar 2015, 20:49
HaHaAnonymous wrote: I do not know how to write macros (not interested in learning it as well). D: But you can write bash scripts and was interested to learn it... One syntax more, one less - it is not a big difference. Maybe you should try to learn FASM macros as well. It is very useful for FASM programming. I guarantee that. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
18 Mar 2015, 20:49 |
|
HaHaAnonymous 18 Mar 2015, 22:46
Quote:
Not really. I just know the very basic things because it is really useful for automating simple tasks. Quote:
Opinion observed. Perhaps one day... Not sure. And another discouraging factor is that there is no way to know what is the current "Time Zone Abbreviation" from %T. D: Not sure. Thank you! |
|||
18 Mar 2015, 22:46 |
|
revolution 18 Mar 2015, 23:12
If you search this board there are already a few macros posted to do time computation and conversions.
The timezone for %t is dependant upon the function make_timestamp in SYSTEM.INC. For Win32 console it is UTC. For other versions (DOS?) it might be local time. |
|||
18 Mar 2015, 23:12 |
|
HaHaAnonymous 19 Mar 2015, 00:06
Quote:
This board search function is pretty useless. Because no matter how descriptive you are it always return thousands of results. Unless you know EXACTLY the thread's title. If yes then it should return as first result, together with thousands of other irrelevant posts and/or topics. A good alternative is to use Google's: "site:<site> <expression>". And that is if you use Google, otherwise check your search engine's commands for more information. But it is not completely useless... It is good to find Author's post. :D I apologize for any inconvenience, if any. D: |
|||
19 Mar 2015, 00:06 |
|
revolution 19 Mar 2015, 00:19
The search provided in this board does not look into the title at all. You can only search the post contents. It can make finding some things tricky. Using an external engine is usually preferred IME.
|
|||
19 Mar 2015, 00:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.