Instruction stringlengths 45 106 | input_code stringlengths 1 13.7k | output_code stringlengths 1 13.7k |
|---|---|---|
Please provide an equivalent version of this COBOL code in Python. | IDENTIFICATION DIVISION.
PROGRAM-ID. epoch.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 epoch-date.
03 year PIC 9(4).
03 month PIC 99.
03 dday PIC 99.
PROCEDURE DIVISION.
MOVE FUNCTION ... | >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Generate an equivalent VB version of this COBOL code. | IDENTIFICATION DIVISION.
PROGRAM-ID. epoch.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 epoch-date.
03 year PIC 9(4).
03 month PIC 99.
03 dday PIC 99.
PROCEDURE DIVISION.
MOVE FUNCTION ... | Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Produce a language-to-language conversion: from COBOL to VB, same semantics. | IDENTIFICATION DIVISION.
PROGRAM-ID. epoch.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 epoch-date.
03 year PIC 9(4).
03 month PIC 99.
03 dday PIC 99.
PROCEDURE DIVISION.
MOVE FUNCTION ... | Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Change the programming language of this snippet from COBOL to Go without modifying what it does. | IDENTIFICATION DIVISION.
PROGRAM-ID. epoch.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 epoch-date.
03 year PIC 9(4).
03 month PIC 99.
03 dday PIC 99.
PROCEDURE DIVISION.
MOVE FUNCTION ... | package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Please provide an equivalent version of this COBOL code in Go. | IDENTIFICATION DIVISION.
PROGRAM-ID. epoch.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 epoch-date.
03 year PIC 9(4).
03 month PIC 99.
03 dday PIC 99.
PROCEDURE DIVISION.
MOVE FUNCTION ... | package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Produce a language-to-language conversion: from REXX to C, same semantics. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Please provide an equivalent version of this REXX code in C. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Convert this REXX block to C#, preserving its control flow and logic. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Maintain the same structure and functionality when rewriting this code in C#. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Preserve the algorithm and functionality while converting the code from REXX to C++. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Translate this program into C++ but keep the logic exactly as in REXX. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Convert this REXX snippet to Java and keep its semantics consistent. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Preserve the algorithm and functionality while converting the code from REXX to Java. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Can you help me rewrite this code in Python instead of REXX, keeping it the same logically? |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Convert this REXX block to Python, preserving its control flow and logic. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Can you help me rewrite this code in VB instead of REXX, keeping it the same logically? |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Change the following REXX code into VB without altering its purpose. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Port the following code from REXX to Go with equivalent syntax and logic. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Produce a functionally identical Go code for the snippet given in REXX. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Ensure the translated C code behaves exactly like the original Ruby snippet. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Rewrite the snippet below in C so it works the same as the original Ruby code. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Ensure the translated C# code behaves exactly like the original Ruby snippet. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Convert the following code from Ruby to C#, ensuring the logic remains intact. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Translate the given Ruby code snippet into C++ without altering its behavior. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Produce a language-to-language conversion: from Ruby to C++, same semantics. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Port the following code from Ruby to Java with equivalent syntax and logic. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Write the same code in Java as shown below in Ruby. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Generate an equivalent Python version of this Ruby code. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Produce a functionally identical Python code for the snippet given in Ruby. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Produce a functionally identical VB code for the snippet given in Ruby. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Generate an equivalent VB version of this Ruby code. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Change the programming language of this snippet from Ruby to Go without modifying what it does. | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Can you help me rewrite this code in Go instead of Ruby, keeping it the same logically? | irb(main):001:0> Time.at(0).utc
=> 1970-01-01 00:00:00 UTC
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Rewrite the snippet below in C so it works the same as the original Scala code. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Port the provided Scala code into C while preserving the original functionality. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Ensure the translated C# code behaves exactly like the original Scala snippet. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Can you help me rewrite this code in C# instead of Scala, keeping it the same logically? |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Change the following Scala code into C++ without altering its purpose. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Transform the following Scala implementation into C++, maintaining the same output and logic. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Write a version of this Scala function in Java with identical behavior. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Generate a Java translation of this Scala snippet without changing its computational steps. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Can you help me rewrite this code in Python instead of Scala, keeping it the same logically? |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Translate this program into Python but keep the logic exactly as in Scala. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Change the programming language of this snippet from Scala to VB without modifying what it does. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Convert this Scala snippet to VB and keep its semantics consistent. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Convert this Scala block to Go, preserving its control flow and logic. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Port the following code from Scala to Go with equivalent syntax and logic. |
import java.util.Date
import java.util.TimeZone
import java.text.DateFormat
fun main( args: Array<String>) {
val epoch = Date(0)
val format = DateFormat.getDateTimeInstance()
format.timeZone = TimeZone.getTimeZone("UTC")
println(format.format(epoch))
}
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Rewrite this program in C while keeping its functionality equivalent to the Tcl version. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Ensure the translated C code behaves exactly like the original Tcl snippet. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| #include <time.h>
#include <stdio.h>
int main() {
time_t t = 0;
printf("%s", asctime(gmtime(&t)));
return 0;
}
|
Change the programming language of this snippet from Tcl to C# without modifying what it does. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Please provide an equivalent version of this Tcl code in C#. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| using System;
class Program
{
static void Main()
{
Console.WriteLine(new DateTime());
}
}
|
Translate this program into C++ but keep the logic exactly as in Tcl. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Change the programming language of this snippet from Tcl to C++ without modifying what it does. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| #include <iostream>
#include <chrono>
#include <ctime>
int main()
{
std::chrono::system_clock::time_point epoch;
std::time_t t = std::chrono::system_clock::to_time_t(epoch);
std::cout << std::asctime(std::gmtime(&t)) << '\n';
return 0;
}
|
Ensure the translated Java code behaves exactly like the original Tcl snippet. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Write the same code in Java as shown below in Tcl. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| import java.text.DateFormat;
import java.util.Date;
import java.util.TimeZone;
public class DateTest{
public static void main(String[] args) {
Date date = new Date(0);
DateFormat format = DateFormat.getDateTimeInstance();
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.p... |
Generate a Python translation of this Tcl snippet without changing its computational steps. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Convert this Tcl block to Python, preserving its control flow and logic. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| >>> import time
>>> time.asctime(time.gmtime(0))
'Thu Jan 1 00:00:00 1970'
>>>
|
Rewrite this program in VB while keeping its functionality equivalent to the Tcl version. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Generate a VB translation of this Tcl snippet without changing its computational steps. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| Sub Main()
Debug.Print Format(0, "dd mmm yyyy hh:mm")
End Sub
|
Preserve the algorithm and functionality while converting the code from Tcl to Go. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Convert this Tcl block to Go, preserving its control flow and logic. | % clock format 0 -gmt 1
Thu Jan 01 00:00:00 GMT 1970
| package main
import ("fmt"; "time")
func main() {
fmt.Println(time.Time{})
}
|
Please provide an equivalent version of this Rust code in PHP. | extern crate time;
use time::{at_utc, Timespec};
fn main() {
let epoch = at_utc(Timespec::new(0, 0));
println!("{}", epoch.asctime());
}
| <?php
echo gmdate('r', 0), "\n";
?>
|
Convert this Rust snippet to PHP and keep its semantics consistent. | extern crate time;
use time::{at_utc, Timespec};
fn main() {
let epoch = at_utc(Timespec::new(0, 0));
println!("{}", epoch.asctime());
}
| <?php
echo gmdate('r', 0), "\n";
?>
|
Write the same code in PHP as shown below in Ada. | with Ada.Text_IO; use Ada.Text_IO;
with Ada.Calendar; use Ada.Calendar;
with Ada.Calendar.Formatting; use Ada.Calendar.Formatting;
with Ada.Calendar.Conversions; use Ada.Calendar.Conversions;
procedure ShowEpoch is
etime : Time := To_Ada_Time (0);
begin
Put_Line (Image (Date => etime));
end ShowEpoch;
| <?php
echo gmdate('r', 0), "\n";
?>
|
Write the same code in PHP as shown below in Ada. | with Ada.Text_IO; use Ada.Text_IO;
with Ada.Calendar; use Ada.Calendar;
with Ada.Calendar.Formatting; use Ada.Calendar.Formatting;
with Ada.Calendar.Conversions; use Ada.Calendar.Conversions;
procedure ShowEpoch is
etime : Time := To_Ada_Time (0);
begin
Put_Line (Image (Date => etime));
end ShowEpoch;
| <?php
echo gmdate('r', 0), "\n";
?>
|
Can you help me rewrite this code in PHP instead of Arturo, keeping it the same logically? | print to :date 0
print now
print to :integer now
| <?php
echo gmdate('r', 0), "\n";
?>
|
Generate a PHP translation of this Arturo snippet without changing its computational steps. | print to :date 0
print now
print to :integer now
| <?php
echo gmdate('r', 0), "\n";
?>
|
Generate an equivalent PHP version of this AWK code. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| <?php
echo gmdate('r', 0), "\n";
?>
|
Write the same code in PHP as shown below in AWK. |
BEGIN {
print(strftime("%Y-%m-%d %H:%M:%S",0,1))
exit(0)
}
| <?php
echo gmdate('r', 0), "\n";
?>
|
Rewrite the snippet below in PHP so it works the same as the original BBC_Basic code. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| <?php
echo gmdate('r', 0), "\n";
?>
|
Port the following code from BBC_Basic to PHP with equivalent syntax and logic. | INSTALL @lib$+"DATELIB"
PRINT FN_date$(0, "dd-MMM-yyyy")
| <?php
echo gmdate('r', 0), "\n";
?>
|
Change the programming language of this snippet from Common_Lisp to PHP without modifying what it does. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| <?php
echo gmdate('r', 0), "\n";
?>
|
Rewrite the snippet below in PHP so it works the same as the original Common_Lisp code. | (multiple-value-bind (second minute hour day month year) (decode-universal-time 0 0)
(format t "~4,'0D-~2,'0D-~2,'0D ~2,'0D:~2,'0D:~2,'0D" year month day hour minute second))
| <?php
echo gmdate('r', 0), "\n";
?>
|
Translate this program into PHP but keep the logic exactly as in Delphi. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| <?php
echo gmdate('r', 0), "\n";
?>
|
Port the following code from Delphi to PHP with equivalent syntax and logic. | program ShowEpoch;
uses SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| <?php
echo gmdate('r', 0), "\n";
?>
|
Keep all operations the same but rewrite the snippet in PHP. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| <?php
echo gmdate('r', 0), "\n";
?>
|
Produce a functionally identical PHP code for the snippet given in Factor. | USING: calendar calendar.format io ;
0 micros>timestamp timestamp>ymdhms print
| <?php
echo gmdate('r', 0), "\n";
?>
|
Write a version of this Forth function in PHP with identical behavior. | include lib/longjday.4th
0 posix>jday .longjday cr
| <?php
echo gmdate('r', 0), "\n";
?>
|
Convert this Forth block to PHP, preserving its control flow and logic. | include lib/longjday.4th
0 posix>jday .longjday cr
| <?php
echo gmdate('r', 0), "\n";
?>
|
Write a version of this Groovy function in PHP with identical behavior. | def date = new Date(0)
def format = new java.text.SimpleDateFormat('yyyy-MM-dd\'T\'HH:mm:ss.SSSZ')
format.timeZone = TimeZone.getTimeZone('UTC')
println (format.format(date))
| <?php
echo gmdate('r', 0), "\n";
?>
|
Generate a PHP translation of this Groovy snippet without changing its computational steps. | def date = new Date(0)
def format = new java.text.SimpleDateFormat('yyyy-MM-dd\'T\'HH:mm:ss.SSSZ')
format.timeZone = TimeZone.getTimeZone('UTC')
println (format.format(date))
| <?php
echo gmdate('r', 0), "\n";
?>
|
Port the following code from Haskell to PHP with equivalent syntax and logic. | import System.Time
main = putStrLn $ calendarTimeToString $ toUTCTime $ TOD 0 0
| <?php
echo gmdate('r', 0), "\n";
?>
|
Convert the following code from Haskell to PHP, ensuring the logic remains intact. | import System.Time
main = putStrLn $ calendarTimeToString $ toUTCTime $ TOD 0 0
| <?php
echo gmdate('r', 0), "\n";
?>
|
Rewrite this program in PHP while keeping its functionality equivalent to the Julia version. | using Base.Dates
println("Time zero (the epoch) is $(unix2datetime(0)).")
| <?php
echo gmdate('r', 0), "\n";
?>
|
Can you help me rewrite this code in PHP instead of Julia, keeping it the same logically? | using Base.Dates
println("Time zero (the epoch) is $(unix2datetime(0)).")
| <?php
echo gmdate('r', 0), "\n";
?>
|
Keep all operations the same but rewrite the snippet in PHP. | d = [0,1,2,3.5,-3.5,1000*365,1000*366,now+[-1,0,1]];
for k=1:length(d)
printf('day
disp(datevec(d(k)))
end;
| <?php
echo gmdate('r', 0), "\n";
?>
|
Port the provided MATLAB code into PHP while preserving the original functionality. | d = [0,1,2,3.5,-3.5,1000*365,1000*366,now+[-1,0,1]];
for k=1:length(d)
printf('day
disp(datevec(d(k)))
end;
| <?php
echo gmdate('r', 0), "\n";
?>
|
Translate the given Nim code snippet into PHP without altering its behavior. | import times
echo "Epoch for Posix systems: ", fromUnix(0).utc
echo "Epoch for Windows system: ", fromWinTime(0).utc
| <?php
echo gmdate('r', 0), "\n";
?>
|
Ensure the translated PHP code behaves exactly like the original Nim snippet. | import times
echo "Epoch for Posix systems: ", fromUnix(0).utc
echo "Epoch for Windows system: ", fromWinTime(0).utc
| <?php
echo gmdate('r', 0), "\n";
?>
|
Produce a functionally identical PHP code for the snippet given in OCaml. | open Unix
let months = [| "January"; "February"; "March"; "April"; "May"; "June";
"July"; "August"; "September"; "October"; "November"; "December" |]
let () =
let t = Unix.gmtime 0.0 in
Printf.printf "%s %d, %d\n" months.(t.tm_mon) t.tm_mday (1900 + t.tm_year)
| <?php
echo gmdate('r', 0), "\n";
?>
|
Change the following OCaml code into PHP without altering its purpose. | open Unix
let months = [| "January"; "February"; "March"; "April"; "May"; "June";
"July"; "August"; "September"; "October"; "November"; "December" |]
let () =
let t = Unix.gmtime 0.0 in
Printf.printf "%s %d, %d\n" months.(t.tm_mon) t.tm_mday (1900 + t.tm_year)
| <?php
echo gmdate('r', 0), "\n";
?>
|
Port the following code from Pascal to PHP with equivalent syntax and logic. | Program ShowEpoch;
uses
SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', Now));
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| <?php
echo gmdate('r', 0), "\n";
?>
|
Port the provided Pascal code into PHP while preserving the original functionality. | Program ShowEpoch;
uses
SysUtils;
begin
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', Now));
Writeln(FormatDateTime('yyyy-mm-dd hh:nn:ss.zzz', 0));
end.
| <?php
echo gmdate('r', 0), "\n";
?>
|
Write a version of this R function in PHP with identical behavior. | > epoch <- 0
> class(epoch) <- class(Sys.time())
> format(epoch, "%Y-%m-%d %H:%M:%S %Z")
[1] "1970-01-01 00:00:00 UTC"
| <?php
echo gmdate('r', 0), "\n";
?>
|
Transform the following R implementation into PHP, maintaining the same output and logic. | > epoch <- 0
> class(epoch) <- class(Sys.time())
> format(epoch, "%Y-%m-%d %H:%M:%S %Z")
[1] "1970-01-01 00:00:00 UTC"
| <?php
echo gmdate('r', 0), "\n";
?>
|
Maintain the same structure and functionality when rewriting this code in PHP. | #lang racket
(require racket/date)
(date->string (seconds->date 0 #f))
| <?php
echo gmdate('r', 0), "\n";
?>
|
Convert this Racket block to PHP, preserving its control flow and logic. | #lang racket
(require racket/date)
(date->string (seconds->date 0 #f))
| <?php
echo gmdate('r', 0), "\n";
?>
|
Translate the given COBOL code snippet into PHP without altering its behavior. | IDENTIFICATION DIVISION.
PROGRAM-ID. epoch.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 epoch-date.
03 year PIC 9(4).
03 month PIC 99.
03 dday PIC 99.
PROCEDURE DIVISION.
MOVE FUNCTION ... | <?php
echo gmdate('r', 0), "\n";
?>
|
Change the programming language of this snippet from COBOL to PHP without modifying what it does. | IDENTIFICATION DIVISION.
PROGRAM-ID. epoch.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 epoch-date.
03 year PIC 9(4).
03 month PIC 99.
03 dday PIC 99.
PROCEDURE DIVISION.
MOVE FUNCTION ... | <?php
echo gmdate('r', 0), "\n";
?>
|
Produce a functionally identical PHP code for the snippet given in REXX. |
options replace format comments java crossref symbols nobinary
import java.text.DateFormat
edate = Date(0)
zulu = DateFormat.getDateTimeInstance()
zulu.setTimeZone(TimeZone.getTimeZone('UTC'))
say zulu.format(edate)
return
| <?php
echo gmdate('r', 0), "\n";
?>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.