News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

powershell and utc time aka greenwich london uk

Started by herge, January 16, 2013, 11:14:23 PM

Previous topic - Next topic

herge


Hi DednDave:

Yes ir did it took me a long time to find it
I just wanted a listing of a file.
I think they changed all the rules
for powershell.
They was dir /p (dos)which more or less
paused the output.

Regards herge
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

herge

 Hi DednDave:



C:\Documents and Settings\User>copy c:masm32\showtim.asm | more con
Cannot access file \\.\con

C:\Documents and Settings\User>


It also eats memory like a pig do not try on very large files
you get an out of memory error i e windows.inc
The more is not working I never had to hit space bar
once. It stops listing when it runs out and you can
not scroll up to start of file.
The
  type filename.ext | more


works for me.

Regards herge

Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

i may have the order wrong - lol
i am not as proficient with dos commands as i used to be   :P

herge

#33
 Hi DednDave:

I final got it go and in German to with a little help
from some assembler pals.


; 24HR.ASM 11:46 AM 6/23/2008
include \masm32\include\masm32rt.inc

.data
public dtbuf
dtbuf db 260 dup(0)
AppName db "Datum und Uhrzeit in der deutschen:", 0
crlf db 13, 10, 0
tf db "HH':'mm':'ss", 0
.code
start proc
invoke GetDateFormat, 1031, DATE_LONGDATE, 0, 0, addr dtbuf, 260
      lea   esi, offset dtbuf
      add   esi , eax  ; eax is len of format
      mov   byte ptr [ esi - 1 ] , " "
      pushad
      mov     eax,esp
      INVOKE  GetTimeFormat,LOCALE_USER_DEFAULT,TIME_FORCE24HOURFORMAT,NULL,NULL, esi,32
      add     esp,32
pop esi
invoke MessageBox, NULL, addr dtbuf, addr AppName, MB_OK
exit
      ret
start endp
    end start



It has not got pass 12 am yet so I am not
100% sure it works yet. But is compiled great.
It does work in the afternoon.
Used Google translate to germanize the title
hope it's clean.
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

herge


Hi Rubber Duck Fans:

By popular demand well just me.
Warning this program uses a kludge i e we cheat.
We get UTC time aka GMT or London England time.
Then we add one to hour to get GMT + 1.
I do not recommend running this program @ 23:00 or 11 PM CET i e German Time.

; 24HR.ASM 11:46 AM 6/23/2008
include \masm32\include\masm32rt.inc

.data
stm    SYSTEMTIME<>
public dtbuf
dtbuf db 260 dup(0)

AppName db "Datum und Uhrzeit in der deutschen:", 0
crlf db 13, 10, 0
tf db "HH':'mm':'ss", 0
.code
start proc
      mov   esi, offset stm
      invoke GetSystemTime, esi; Get UTC
      mov   ax, stm.wHour
      inc   ax; GET UTC +1 i e CET
      mov   stm.wHour, ax 
invoke GetDateFormat, 1031, DATE_LONGDATE, addr stm, 0, addr dtbuf, 260
      lea   esi, offset dtbuf
      add   esi , eax  ; eax is len of format
      mov   byte ptr [ esi - 1 ] , " "
      pushad
      mov     eax,esp
      INVOKE  GetTimeFormat,1031,TIME_FORCE24HOURFORMAT,addr stm,NULL, esi,32
      add     esp,32
pop esi
invoke MessageBox, NULL, addr dtbuf, addr AppName, MB_OK
exit
      ret
start endp
    end start


We have now got GMT + 1 which is CET i e time in Berlin, Germany,

Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

      mov   ax, stm.wHour
      inc   ax; GET UTC +1 i e CET
      cmp   ax, 24
      jb    @F

      sub   ax, 24

@@:   mov   stm.wHour, ax 


or

      mov   ax, stm.wHour
      sub   ax, 23; GET UTC +1 i e CET
      jae   @F

      add   ax, 24

@@:   mov   stm.wHour, ax 

herge


Hi DednDav:

I am sure sure there is an easier way.
But for now it goes.

Thanks for the ideas.
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

of course - you could use the right Locale Identifier   :biggrin:

herge


Hi DednDave:

Tossed first example in qeditor.
Compiled and tosed it to WinDbg.

Herge Says All Right!
Thanks DednDave.
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

the second one is a little better, i think   :t
should be 2 bytes shorter

herge

#40
 Hi DednDave:

The LCID for germany is 1031 decimal that's why
we get nice German names.

A site to look up your LCID @ MicroSoft.


http://msdn.microsoft.com/en-us/library/ms912047(v=winembedded.10).aspx


Regards herge
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

herge

#41
 Hi Rubber Duck & UTC & GMT & Zulu Fans:

We got all that. To check your computer date and time the
folks in Ottawa, Ontario, CANADA have a site @ NRC.
I will let people @NRC explain NRC.


http://time5.nrc.ca/JavaClock/timeDisplayWE.shtml


For America try NIST.

http://nist.time.gov/

Pick Your Time Zone and Go.
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

i used to visit CHU at 7.335 mHz (they broadcast on a couple other frequencies, as well)
a few years ago, they expanded the international broadcast band in ITU regions 1 and 3
CHU experienced some interference, so they moved to 7.85 mHz or something like that

here in the US, we have WWV (and WWVL, WWVB)
they broadcast at several frequencies, most notably 2.5, 5, 10, 15, 20 mHz
WWVL is at 20 kHz and WWVB is at 60 kHz

you can see what CHU sounds like, here...
http://en.wikipedia.org/wiki/CHU_%28radio_station%29#Time_signal_format

herge


Hi DednDave:

We are going to the dogs.
Breaker one nine oh the good
old CB radios before portable telephones.
There use to be size of a lunch box. Now
about the size of a pack of fags(smokes, cigarettes).
Regards herge
Read "Slow Death by Rubber Duck"
for chemical Laughs.

dedndave

heathkit used to make one we called the "lunchbox"   :P
they made them for 3 different ham bands and one for cb, too
back then, probably the cheapest way to get on the air