News:

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

Main Menu

What's up Time Format

Started by herge, January 30, 2013, 06:54:28 AM

Previous topic - Next topic

herge


Hi Everbody:


; REM SHOWTIM.ASM Tuesday, January 25, 2011 8:22 AM
; Author: Herge
; Location: Waterloo, Ontario, CANADA
.586
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
.data
stm  SYSTEMTIME<>
dateformat  db " dddd, MMMM, dd, yyyy", 0
timeformat  db "hh':'mm':'ss tt",0 ; Here
date_buf db 260 dup (0)
        db 2 dup (0)
.code

start   proc    near
      invoke   GetLocalTime, addr stm; put Values in stm
      invoke   GetDateFormat, 0, 0, \
               0, ADDR dateformat, ADDR date_buf, 260
; Print Date
invFor:
invoke GetDateFormat, 0, 0, \
            ADDR stm, ADDR dateformat, ADDR date_buf, 260
mov ecx, offset date_buf
mov byte ptr [ eax + ecx - 1 ], ' ';replace null with space
      add   ecx, eax 
; Print Time!
invPrt:
invoke GetTimeFormat, 0, 0, \
                  ADDR stm, ADDR timeformat, ecx, 20
invMess:
invoke MessageBox, 0, addr date_buf, addr date_buf, MB_OK
invX:
      invoke      ExitProcess, 0
start   endp     
        end start



I have two computers with masm32 on them.
One does Not show the AM/PM in the message box even thou date_buf has
the correct bytes. I compiled on both computers and took code back and forth.
windbg says all is cool but still shows the wrong output. I get 3 dots in Title Bar.
This computer is having problems with search.


Any Ideas ?
or suggestions.

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

MichaelW

The code works fine on my Windows 2000 system. I tried changing the time format in Control Panel/Regional Options to eliminate the AM/PM field, and even after a reboot the code still displayed the field. You could try experimenting with the Locale and dwFlags parameters.
Well Microsoft, here's another nice mess you've gotten us into.

herge


Hi MichaelW:

I think it's this computer I am having DEP errors and Search is not finding anything,
ie dir > temp.txt qeditor temp.txt and copy a filename to search and nothing happens.
I have a powershell installed and the ISE does not behave the same as Powershell.
Also I found out you have .\filename or it will grab the same Filename which is before
you on the Path. It took me a while to figure out. The examples for Powershell are
at the usually low standards we have to accept. They think the command prompt
will execute i e c:\masm32\bin>
# is a REM marker
The certificate Storage X.509 is not very well set up
and have not got it sorted yet old Dos batch commands in Powershell don't do
anything.
Each error produces at least 4 red lines of absolute drivel he/she must have
been a former tech writer,
You also have to watch your Dots and Commas. especially in a popup box!
Having a bad time with some sort of RunDLL32.exe virius on other machine.

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

Magnum

Quote from: herge on January 30, 2013, 08:35:32 AM

Hi MichaelW:

I think it's this computer I am having DEP errors and Search is not finding anything,
ie dir > temp.txt qeditor temp.txt and copy a filename to search and nothing happens.
I have a powershell installed and the ISE does not behave the same as Powershell.
Also I found out you have .\filename or it will grab the same Filename which is before
you on the Path. It took me a while to figure out. The examples for Powershell are
at the usually low standards we have to accept. They think the command prompt
will execute i e c:\masm32\bin>
# is a REM marker
The certificate Storage X.509 is not very well set up
and have not got it sorted yet old Dos batch commands in Powershell don't do
anything.
Each error produces at least 4 red lines of absolute drivel he/she must have
been a former tech writer,
You also have to watch your Dots and Commas. especially in a popup box!
Having a bad time with some sort of RunDLL32.exe virius on other machine.

Regards herge

Thanks.

Your time program worked fine on WinXP Pro.

Kaspersky makes a good rescue disk that you  put on a CD.

Besides scanning, it also lets you makes reg changes, and download updates.

Andy

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

Adamanteus

I also agree that problem with change locale exists - so, except SetLocaleInfo no documented way to do it. And I don't know GetDateFormat is based on GetLocaleInfo output or not, but maybe need to begin search somewhere there.

dedndave

i think i found the problem

; Location: Waterloo, Ontario, CANADA

isn't it always PM up there ?   ;)

Magnum

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

frktons

On my pc win7/64 it works fine.
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

herge


Hi dedndave :

True, but the other half of the night is AM.

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