tests: lib: move time to new ztest API

Move test lib/time to use new ztest API.

Signed-off-by: li biao <biao1x.li@intel.com>
diff --git a/tests/lib/time/prj.conf b/tests/lib/time/prj.conf
index 786d6bc..2f34cdf 100644
--- a/tests/lib/time/prj.conf
+++ b/tests/lib/time/prj.conf
@@ -1,2 +1,3 @@
 CONFIG_ZTEST=y
 CONFIG_POSIX_CLOCK=y
+CONFIG_ZTEST_NEW_API=y
diff --git a/tests/lib/time/src/main.c b/tests/lib/time/src/main.c
index f247e39..1cfe61a 100644
--- a/tests/lib/time/src/main.c
+++ b/tests/lib/time/src/main.c
@@ -7,7 +7,7 @@
 #include <ztest.h>
 #include <time.h>
 
-static void test_time_passing(void)
+ZTEST(libc_time, test_time_passing)
 {
 	time_t time_initial_unaligned;
 	time_t time_initial;
@@ -41,7 +41,7 @@
 	}
 }
 
-static void test_time_param(void)
+ZTEST(libc_time, test_time_param)
 {
 	time_t time_result;
 	time_t time_param;
@@ -60,11 +60,4 @@
 	}
 }
 
-void test_main(void)
-{
-	ztest_test_suite(libc_time,
-			ztest_unit_test(test_time_passing),
-			ztest_unit_test(test_time_param)
-			);
-	ztest_run_test_suite(libc_time);
-}
+ZTEST_SUITE(libc_time, NULL, NULL, NULL, NULL, NULL);