查找

Article
· Jul 4, 2024 1m read

How to change the special variable $ZTIMESTAMP to your local time zone

InterSystems FAQ rubric

$ZTIMESTAMP returns the date and time in UTC format, so to change it to the local time zone, use the following system method: 

$SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP)

The above output will be in the format ddddd,sssss.fff.

    ddddd: Same format as $HOROLOG dates
 sssss: An integer indicating the number of seconds elapsed since midnight on the current date
 fff: Variable number of digits indicating the fractional part of a second

* Similar to $HOROLOG, except that $HOROLOG does not include fractional seconds. 

SAMPLES>write $SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP)," - ", $horolog,!
63895,64252.66 - 63895,64252
SAMPLES>write $ZDATETIME($SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP),8)
20151209 17:45:56
SAMPLES>write $ZDATETIME($ZTIMESTAMP,8)
20151209 08:46:05
SAMPLES>
1 Comment
Discussion (1)1
Log in or sign up to continue
Question
· Jul 4, 2024

forward REST calls and retain path parameters

Hi, I have a controller which handles accounts, and forwards to the relevant controller based on the path, example below:

XData UrlMap
{
<Routes>

<Map Prefix="/:accountId/anothercontroller" Forward="AnotherController"/>

</Routes>
}

Problem is that inside AnotherController, the accountId path parameter is lost, I assume that's because the map forward simply checks if there's a match then forwards.

AnotherController:

XData UrlMap
{
<Routes>

<Route Url="/:somethingId" Method="POST" Call="CreateSomething"/>

</Routes>
}
ClassMethod CreateSomething(somethingId)
{
}

The reason for this is because I don't want to specify the same route including the accountId for many routes, instead is it possible to forward the accountId to get something like this:

XData UrlMap
{
<Routes>

<Route Url="/:somethingId" Method="POST" Call="CreateSomething"/>

</Routes
}
/// accountId passed through and accessible
ClassMethod CreateSomething(accountId, somethingId)
{
}

 

We'll be upgrading to IRIS soon, so if it is possible there I'd love to know where I can read more about how to do so.

Thank you.

2 Comments
Discussion (2)0
Log in or sign up to continue
Article
· Jul 4, 2024 9m read

Criação de uma aplicação web React simples com backend IRIS: resolução de CORS

Integrar aplicações frontend de React com serviços backend como a base de dados IRIS através de APIs REST pode ser uma forma poderosa de contruir aplicações web robustas. No entanto, um obstáculo comum que os desenvolvedores costumam encontrar é o problema de Cross-Origin Resource Sharing (CORS), que pode impedir que o frontend acesse os recursos no backend devido a restrições de segurança impostas pelos navegadores web. Nesse artigo, exploraremos como abordar os problemas de CORS ao integrar aplicações web de React com serviços backend de IRIS.

Discussion (0)1
Log in or sign up to continue
Question
· Jul 4, 2024

Failed to start the Gateway server: ERROR #5023: Remote Gateway Error: Communication failure on port: 5000 > ERROR #5001: External Language Server: invalid ping response

Our client getting sometimes this error and we need to change port number on JavaGateway process to continue,

Failed to start the Gateway server: ERROR #5023: Remote Gateway Error: Communication failure on port: 5000
> ERROR #5001: External Language Server: invalid ping response

 

Can you tell as why it is happenning? intersystems runtime is under linux.

6 Comments
Discussion (6)3
Log in or sign up to continue
Question
· Jul 4, 2024

Why do I have running jobs with no Process ID?

We have a business process that seems have extra jobs hanging around.  This is what we see in the Jobs tab:

Only the bottom one is actually associated with a process.  So what are those other ones?  There are no queues and I have no way of finding out why they're there.

Thanks.

1 Comment
Discussion (1)2
Log in or sign up to continue