Page 1 of 1

How to use HB_DateTimeToSeconds() function?

Posted: Tue Apr 08, 2025 7:19 am
by richard-service
Dear Antonio,
I use this HB_DateTimeToSeconds() function and get error below:

Compiling...
Harbour 3.2.0dev (r2404101339)
Copyright (c) 1999-2021, https://harbour.github.io/
Compiling 'testfV.prg' and generating preprocessed output to 'testfV.ppo'...
Lines 5063, Functions/Procedures 2
Generating C source output to 'testfV.c'... Done.
Embarcadero C++ 7.70 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
testfV.c:
Turbo Incremental Link 6.97 Copyright (c) 1997-2022 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_HB_DATETIMETOSECONDS' referenced from D:\FWH2402\SAMPLES\TESTFV.OBJ
Error: Unable to perform link
* Linking errors *

Re: How to use HB_DateTimeToSeconds() function?

Posted: Tue Apr 08, 2025 8:07 am
by Enrico Maria Giordano
There is no such a function in the whole Harbour and xHarbour repository. Please check the function name.

Re: How to use HB_DateTimeToSeconds() function?

Posted: Tue Apr 08, 2025 8:16 am
by Antonio Linares
Dear Richard,

Please copy testfv.prg source code here, thanks

Re: How to use HB_DateTimeToSeconds() function?

Posted: Tue Apr 08, 2025 9:48 am
by MaxP
Hi Richard,

Could this feature be useful to you?

Code: Select all | Expand

SecondsFrom1970()

#pragma BEGINDUMP

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include "hbapi.h"

HB_FUNC( SECONDSFROM1970 )

{
        unsigned long count;
        time_t *tmppointer=NULL;
        
        count = time( tmppointer ) ;
        
        hb_retnl( count ) ;
}

#pragma ENDDUMP
Massimo